Skip to content

HubEauContrib/HubEauKit.net

Repository files navigation

HubEauKit - the C# library for the API Hub'Eau - Ecoulement des cours d'eau

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: vbeta
  • SDK version: 1.0.0
  • Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen

Frameworks supported

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using HubEauKit.Api;
using HubEauKit.Client;
using HubEauKit.Model;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out HubEauKit.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using HubEauKit.Api;
using HubEauKit.Client;
using HubEauKit.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://hubeau.eaufrance.fr/api";
            var apiInstance = new EcoulementApi(config);
            var codeStation = new List<string>?(); // List<string>? | Code(s) Sandre de la station hydrométrique. Valeurs possibles : http://services.sandre.eaufrance.fr/geo/hyd?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&typename=StationHydro_FXX&SRSNAME=EPSG:2154&OUTPUTFORMAT=GEOJSON. Séparer les valeurs par des virgules. Nombre maximum de valeurs : 200 (optional) 
            var libelleStation = new List<string>?(); // List<string>? | Libellé(s) Sandre de la station hydrométrique. Valeurs possibles : http://services.sandre.eaufrance.fr/geo/hyd?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&typename=StationHydro_FXX&SRSNAME=EPSG:2154&OUTPUTFORMAT=GEOJSON. Séparer les valeurs par des virgules. Nombre maximum de valeurs : 200 (optional) 
            var codeDepartement = new List<string>?(); // List<string>? | Code(s) INSEE du département associé à la station. Séparer les valeurs par des virgules. Nombre maximum de valeurs : 200 (optional) 
            var libelleDepartement = new List<string>?(); // List<string>? | Libellé(s) INSEE du département associé à la station. Séparer les valeurs par des virgules. Nombre maximum de valeurs : 200 (optional) 
            var codeCommune = new List<string>?(); // List<string>? | Code(s) INSEE de la commune associée à la station. Séparer les valeurs par des virgules. Nombre maximum de valeurs : 200 (optional) 
            var libelleCommune = new List<string>?(); // List<string>? | Libellé(s) INSEE de la commune associée à la station. Séparer les valeurs par des virgules. Nombre maximum de valeurs : 200 (optional) 
            var codeRegion = new List<string>?(); // List<string>? | Code(s) INSEE de la région associée à la station. Séparer les valeurs par des virgules. Nombre maximum de valeurs : 200 (optional) 
            var libelleRegion = new List<string>?(); // List<string>? | Libellé(s) INSEE de la région associée à la station. Séparer les valeurs par des virgules. Nombre maximum de valeurs : 200 (optional) 
            var codeBassin = new List<string>?(); // List<string>? | Code(s) Sandre de la circonscription administrative de bassin. Valeurs possibles : http://id.eaufrance.fr/NSA/447. Séparer les valeurs par des virgules. Nombre maximum de valeurs : 15 (optional) 
            var libelleBassin = new List<string>?(); // List<string>? | Libellé(s) Sandre de la circonscription administrative de bassin. Valeurs possibles : http://id.eaufrance.fr/NSA/447. Séparer les valeurs par des virgules. Nombre maximum de valeurs : 15 (optional) 
            var codeCoursEau = new List<string>?(); // List<string>? | Code(s) Sandre du cours d'eau associé à la station hydrométrique. Valeurs possibles : https://api.sandre.eaufrance.fr/referentiels/v1/cea.json. Séparer les valeurs par des virgules. Nombre maximum de valeurs : 200 (optional) 
            var libelleCoursEau = new List<string>?(); // List<string>? | Libellé(s) Sandre du cours d'eau associée à la station hydrométrique. Valeurs possibles : https://api.sandre.eaufrance.fr/referentiels/v1/cea.json. Séparer les valeurs par des virgules. Nombre maximum de valeurs : 200 (optional) 
            var longitude = 1.2D;  // double? | Longitude du point en WGS84 pour la recherche par rayon, le point doit être utilisé comme séparateur décimal, exemple : 1.937 (optional) 
            var latitude = 1.2D;  // double? | Latitude du point en WGS84 pour la recherche par rayon, le point doit être utilisé comme séparateur décimal, exemple : 47.829 (optional) 
            var distance = 1.2D;  // double? | Rayon de recherche en kilomètre, le point doit être utilisé comme séparateur décimal, exemple : 30 (optional) 
            var bbox = new List<double>?(); // List<double>? | Rectangle d'emprise de l'objet demandé, emprise au format : min longitude, min latitude, max longitude, max latitude avec les coordonnées en WGS84 (EPSG:4326), le point doit être utilisé comme séparateur décimal, exemple : 1.6194,47.7965,2.1910,47.9988 (optional) 
            var sort = "asc";  // string? |  (optional) 
            var numroDeLaPage = 56;  // int? |  (optional) 
            var size = 20;  // int? |  (optional)  (default to 20)
            var listeDesChampsSouhaitsDansLaRponseFonctionnalitExprimentaleParExempleFieldscodeStationlocalisation = "listeDesChampsSouhaitsDansLaRponseFonctionnalitExprimentaleParExempleFieldscodeStationlocalisation_example";  // string? |  (optional) 

            try
            {
                // Lister les stations au format CSV
                Station result = apiInstance.GetChroniqueCsv(codeStation, libelleStation, codeDepartement, libelleDepartement, codeCommune, libelleCommune, codeRegion, libelleRegion, codeBassin, libelleBassin, codeCoursEau, libelleCoursEau, longitude, latitude, distance, bbox, sort, numroDeLaPage, size, listeDesChampsSouhaitsDansLaRponseFonctionnalitExprimentaleParExempleFieldscodeStationlocalisation);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling EcoulementApi.GetChroniqueCsv: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://hubeau.eaufrance.fr/api

Class Method HTTP request Description
EcoulementApi GetChroniqueCsv GET /vbeta/ecoulement/stations.csv Lister les stations au format CSV
EcoulementApi GetChroniqueCsv1 GET /vbeta/ecoulement/observations.csv Lister les observations au format CSV
EcoulementApi GetChroniqueCsv2 GET /vbeta/ecoulement/campagnes.csv Lister les campagnes au format CSV
EcoulementApi GetCommunes GET /vbeta/ecoulement/campagnes Lister les campagnes
EcoulementApi GetResultats GET /vbeta/ecoulement/stations Lister les stations
EcoulementApi GetResultats1 GET /vbeta/ecoulement/observations Lister les observations

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

About

An unofficial Hub'Eau API client library for .NET

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages