This project contains Swift code that generates a API clients from Discovery Documents produced by the Google API Discovery Service.
It is experimental work-in-progress, but provides a good start at calling many Google APIs from Swift. Our focus is on supporting calls from server-side and command-line Swift applications, but calls from any platform with Swift support should be possible.
API clients are be produced by running the generator with Discovery Documents downloaded from the Discovery Service. Running the following writes a client to standard output:
google-api-swift-generator <discovery-document-filename>
This can be redirected to a file for easier inspection:
google-api-swift-generator <discovery-document-filename> > client.swift
This project also includes an experimental CLI generator that
generates command-line interfaces for APIs. These CLIs depend
on the generated client libraries and are produced with the
google-cli-swift-generator
command. Running the following
writes a CLI main.swift
to standard output:
google-cli-swift-generator <discovery-document-filename>
The Examples directory contains several example clients including scripts for generating both client libraries and CLIs.
We'd love to collaborate on this. See CONTRIBUTING.md for details.
Copyright 2019, Google Inc.
Released under the Apache 2.0 license.