api_geo_client
ApiGeoClient - the Ruby gem for the API Référentiels géographiques
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.0.0-beta
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.RubyClientCodegen
Installation
Build a gem
To build the Ruby code into a gem:
gem build api_geo_client.gemspec
Then either install the gem locally:
gem install ./api_geo_client-1.0.0.gem
(for development, run gem install --dev ./api_geo_client-1.0.0.gem
to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'api_geo_client', '~> 1.0.0'
Install from Git
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
gem 'api_geo_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Getting Started
Please follow the installation procedure and then run the following code:
# Load the gem
require 'api_geo_client'
api_instance = ApiGeoClient::CommunesApi.new
code = 'code_example' # String | Code INSEE de la commune
opts = {
fields: ['[\"nom\",\"code\",\"codesPostaux\",\"codeDepartement\",\"codeRegion\",\"population\"]'], # Array<String> | Liste des champs souhaités dans la réponse
format: 'json', # String | Format de réponse attendu
geometry: 'centre' # String | Géométrie à utiliser pour la sortie géographique
}
begin
#Récupérer les informations concernant une commune
result = api_instance.communes_code_get(code, opts)
p result
rescue ApiGeoClient::ApiError => e
puts "Exception when calling CommunesApi->communes_code_get: #{e}"
end
Documentation for API Endpoints
All URIs are relative to https://geo.api.gouv.fr
Class | Method | HTTP request | Description |
---|---|---|---|
ApiGeoClient::CommunesApi | communes_code_get | GET /communes/{code} | Récupérer les informations concernant une commune |
ApiGeoClient::CommunesApi | communes_get | GET /communes | Recherche des communes |
ApiGeoClient::CommunesApi | departements_code_communes_get | GET /departements/{code}/communes | Renvoi les communes d'un département |
ApiGeoClient::DpartementsApi | departements_code_communes_get | GET /departements/{code}/communes | Renvoi les communes d'un département |
ApiGeoClient::DpartementsApi | departements_code_get | GET /departements/{code} | Récupérer les informations concernant un département |
ApiGeoClient::DpartementsApi | departements_get | GET /departements | Recherche des départements |
ApiGeoClient::DpartementsApi | regions_code_departements_get | GET /regions/{code}/departements | Renvoi les départements d'une région |
ApiGeoClient::RgionsApi | regions_code_departements_get | GET /regions/{code}/departements | Renvoi les départements d'une région |
ApiGeoClient::RgionsApi | regions_code_get | GET /regions/{code} | Récupérer les informations concernant une région |
ApiGeoClient::RgionsApi | regions_get | GET /regions | Recherche des régions |
Documentation for Models
Documentation for Authorization
All endpoints do not require authorization.