Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google

DSL wrappers for java google libs

Setup

repositories {
    mavenCentral()
}
  • Kotlin DSL:
implementation("ru.raysmith:google:2.0.0")
  • Kotlin with TOML:
raysmith-google = { module = "ru.raysmith:google", version = "2.0.0" }
implementation(libs.raysmith.google)
  • Groovy:
implementation 'ru.raysmith:google:2.0.0'

Usage

Quick start

Initialize service:

  1. Create or select existed project at Google Cloud Console
  2. Enable API Service (e.g. Google Sheets API)
  3. Create Service Accounts Credentials
  4. Add JSON key for created service account and download file.
  5. Add downloaded my_secret.json to resources/path/to/secrets/my_secret.json
val service = GoogleSheetsService(GoogleSheetsService.service("MyApplication", "path/to/secrets/my_secret.json"))
service.Spreadsheets.Values.get(
    spreadsheetId = "spreadsheetId",
    range = Range("Sheet1"),
    fields = ValueRangeFields.values + ValueRangeFields.majorDimension
).forEach { row ->
    row.forEach { cell ->
        println(cell.asString)
    }
}

About

DSL wrappers for java google libs

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages