gcplat

Google Cloud Platform (GCP) APIs

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install gcplat
choosenim install gcplat
git clone https://github.com/disruptek/gcplat

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
gcplat - - - - - - -

Source

Repository https://github.com/disruptek/gcplat
Homepage https://github.com/disruptek/gcplat
Registry Source nimble_official

README

gcplat

Google Cloud Platform (GCP) APIs in Nim

Work in Progress

Haven't decided how to handle parameters with empty strings, so for now, you need to supply JSON arguments to the call as per the fallback https://github.com/disruptek/openapi syntax...

Supported APIs

Sadly, only the 180 most popular GCP APIs are supported at this time. :cry:

Example

Your import statement names the APIs you want to use and the versions of same, with any hyphens or periods turned into underscores.

import asyncdispatch
import httpclient
import httpcore

import gcplat/firebase_v1beta1  # ie. Firebase v1beta1

# setup authentication with supplied service account credentials
var auth = newAuthenticator("/some/path/service_account.json")

# add some scopes
auth.scope.add "https://www.googleapis.com/auth/cloud-platform"
auth.scope.add "https://www.googleapis.com/auth/logging.write"
auth.scope.add "https://www.googleapis.com/auth/drive"

let
  request = firebaseProjectsList.call(path=nil, query=nil, header=nil,
                                      formData=nil, body=nil)
  response = request.retried()
echo waitfor response.body

# you can optionally refresh your authentication token manually
# (by default we ensure the token will last at least 10 seconds)

# to make sure this token won't expire in the next 60 seconds
let freshFor1min = waitfor authenticate(fresh = 60)
assert freshFor1min == true

# to fetch a new token that will expire in 15min
let lasts15min = waitfor authenticate(lifetime = 15 * 60)
assert lasts15min == true

Details

This project is based almost entirely upon the following:

  • OpenAPI Code Generator https://github.com/disruptek/openapi

Patches welcome!

License

MIT