Skip to content

Commit

Permalink
v0.6.0 (#7)
Browse files Browse the repository at this point in the history
* fix page size for list roles

* update deps

* Update deps and switch to Go 1.18

* Add mention for language preference

* comment out docs function

* fix comment

* minor refactoring

* update deps

* whitespace

* gofmt -w -r 'interface{} -> any'

* refactor backoff

* Update year

* bump version

* format

* Update third party licenses
  • Loading branch information
hanneshayashi committed Apr 24, 2022
1 parent 4604b6e commit f919624
Show file tree
Hide file tree
Showing 769 changed files with 1,511 additions and 1,536 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.18
- name: Import GPG key
id: import_gpg
uses: hashicorp/ghaction-import-gpg@v2.1.0
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
## GSM
# GSM

GoSpace Manager - Manage Google Workspace resources using a developer-friendly CLI written in Go.

[![Go Report Card](https://goreportcard.com/badge/github.com/hanneshayashi/gsm)](https://goreportcard.com/report/github.com/hanneshayashi/gsm)

### Documentation
## Documentation

View complete documentation at https://gsm.hayashi-ke.online/.

### Introduction
## Introduction

GSM is like gcloud for Google Workspace. It is a no-dependency, free and open source command line interface (CLI) for managing Google Workspace resources. You don't need any software except for the [GSM binary](https://github.com/hanneshayashi/gsm/releases) itself and it is easy to [set up](https://gsm.hayashi-ke.online/setup).

Expand All @@ -27,7 +27,7 @@ GSM was intentionally designed to be as close to the actual APIs as possible.\
Because of that, it may not be as user-friendly as some of the alternatives out there.\
On the plus-side, you can usually look at the Google API documentation that is linked to in every command's description to figure out how something works. Most flag descriptions are also taken from the official API docs, so I take no credit there.

### Features
## Features

GSM currently supports the following APIs:
- [Admin SDK Directory API](https://developers.google.com/admin-sdk/directory)
Expand Down Expand Up @@ -57,15 +57,15 @@ See [Setup](https://gsm.hayashi-ke.online/setup) on how to set up GSM in these m

You can also set up multiple configurations using [gsm configs](https://gsm.hayashi-ke.online/gsm/configs) and switch between them using [gsm configs load](https://gsm.hayashi-ke.online/gsm/configs/load) or by specifying the name of the config with the `--config` flag.

### Output
## Output

GSM is a CLI for the official Google API. It is designed to be easily usable in scripts and workflows. To that end, I made the decision to ommit the implementation of "interesting" output that tells you what GSM is doing, because, while it may be neat to watch, it doesn't serve a purpose when you want to create a script that actually uses the output and I hate the idea of parsing unformatted text to make decisions. Therefore, all* of GSM's console output is parseable JSON or XML (mostly what the API returns).

If you want to use GSM's output in scripts, you may want to consider using the `--compressOutput` flag, to keep GSM from unnecessarily "prettying up" the output. Depending on the tools you use and how you want to build your workflow, you may also want to consider using the `--streamOutput` flag, which will cause GSM to stream single objects directly to stdout. This may be significantly faster and use a lot less memory, but keep in mind that not all applications can properly utilize a stream of JSON objects.

*the [configs](https://gsm.hayashi-ke.online/gsm/configs) command is a notable exception.

#### Scripting examples
### Scripting examples

I highly recommend considering using GSM together with PowerShell or Python when creating scripts.\
GSM works nicely with PowerShell's ConvertFrom-Json commandlet (although there are some [issues with very large amounts of data](https://gsm.hayashi-ke.online/scripting/#processing-very-large-amounts-of-data-with-powershell)).
Expand All @@ -75,18 +75,18 @@ You can take a look at some examples under [scripting](https://gsm.hayashi-ke.on
You can also try the auto-generated [PowerShell module](https://github.com/hanneshayashi/gsm-powershell).\
Note that this module is created with [Crescendo](https://github.com/PowerShell/Crescendo), which is also still in beta. However, for an auto-generated module, it seems to work reasonably well. The module also automatically utilizes streaming.

#### Logging
### Logging

As useful as the above may be, sometimes you need to understand what is happening or need to know why something didn't work as expected. For those times, GSM creates a log file in your home directory called "gsm.log" that contains error messages.\
You can configure the location and name of the log file, either in your config file (see [configs](https://gsm.hayashi-ke.online/gsm/configs)) or by using the `--log` flag when running a command.
You can also use the [log command](https://gsm.hayashi-ke.online/gsm/log) to view or clear the log, wthout having to manually open it.

### License and Copyright
## License and Copyright

GoSpace Manager (GSM) is licensed under the [GPLv3](https://gsm.hayashi-ke.online/license) as free software.\
Copyright © 2020-2021 Hannes Hayashi.
Copyright © 2020-2022 Hannes Hayashi.

### Third Party Libraries
## Third Party Libraries

GSM is based on open source technology and would not exist without the incredible work of some people:
- The engineers at Google who created the APIs and Go libraries GSM is based on
Expand All @@ -95,12 +95,12 @@ GSM is based on open source technology and would not exist without the incredibl
- https://github.com/spf13/cobra
- See https://github.com/hanneshayashi/gsm/tree/main/third_party_licenses for a full list of third party licenses

### See Also
## See Also

* [Setup](https://gsm.hayashi-ke.online/setup) - How to set up GSM
* [GSM](https://gsm.hayashi-ke.online/gsm) - Command overview
* [Batch commands](https://gsm.hayashi-ke.online/batch_commands) - How to use batch commands
* [Recursive commands](https://gsm.hayashi-ke.online/recursive_commands) - How to use recursive commands
* [Examples](https://gsm.hayashi-ke.online/examples) - See some examples
* [Scripting examples](https://gsm.hayashi-ke.online/scripting) - Some examples on how to use GSM in scripts
* [PowerShell module](https://github.com/hanneshayashi/gsm-powershell) - Auto-generated PowerShell module
* [PowerShell module](https://github.com/hanneshayashi/gsm-powershell) - Auto-generated PowerShell module
4 changes: 2 additions & 2 deletions cmd/about.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -46,7 +46,7 @@ var aboutFlags map[string]*gsmhelpers.Flag = map[string]*gsmhelpers.Flag{
Type: "string",
Description: `Fields allows partial responses to be retrieved.
See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.`,
Defaults: map[string]interface{}{"get": "user(displayName, emailAddress, permissionId)"},
Defaults: map[string]any{"get": "user(displayName, emailAddress, permissionId)"},
},
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/about_get.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions cmd/activities.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -44,7 +44,7 @@ var activityFlags map[string]*gsmhelpers.Flag = map[string]*gsmhelpers.Flag{
AvailableFor: []string{"list"},
Type: "string",
Description: `Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique Workspace profile ID or their primary email address.`,
Defaults: map[string]interface{}{"list": "all"},
Defaults: map[string]any{"list": "all"},
},
"applicationName": {
AvailableFor: []string{"list"},
Expand Down
2 changes: 1 addition & 1 deletion cmd/activities_list.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/asps.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/asps_delete.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/asps_delete_batch.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/asps_get.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/asps_get_batch.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/asps_list.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/asps_list_batch.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/asps_list_recursive.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions cmd/attachments.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -45,7 +45,7 @@ var attachmentFlags map[string]*gsmhelpers.Flag = map[string]*gsmhelpers.Flag{
Type: "string",
Description: `The user's email address.
The special value me can be used to indicate the authenticated user.`,
Defaults: map[string]interface{}{"get": "me"},
Defaults: map[string]any{"get": "me"},
},
"messageId": {
AvailableFor: []string{"get"},
Expand Down
2 changes: 1 addition & 1 deletion cmd/attachments_get.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/attachments_get_batch.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions cmd/buildings.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -52,7 +52,7 @@ var buildingFlags map[string]*gsmhelpers.Flag = map[string]*gsmhelpers.Flag{
AvailableFor: []string{"delete", "get", "insert", "list", "patch"},
Type: "string",
Description: `The unique ID for the customer's Workspace account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID.`,
Defaults: map[string]interface{}{"delete": "my_customer", "get": "my_customer", "insert": "my_customer", "list": "my_customer", "patch": "my_customer"},
Defaults: map[string]any{"delete": "my_customer", "get": "my_customer", "insert": "my_customer", "list": "my_customer", "patch": "my_customer"},
},
"coordinatesSource": {
AvailableFor: []string{"insert", "patch"},
Expand Down
2 changes: 1 addition & 1 deletion cmd/buildings_delete.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/buildings_delete_batch.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/buildings_get.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/buildings_get_batch.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/buildings_insert.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/buildings_insert_batch.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/buildings_list.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/buildings_patch.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/buildings_patch_batch.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
8 changes: 4 additions & 4 deletions cmd/calendaracl.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -46,7 +46,7 @@ var calendarACLFlags map[string]*gsmhelpers.Flag = map[string]*gsmhelpers.Flag{
Type: "string",
Description: `Calendar identifier. To retrieve calendar IDs call the calendarAcl.acl method.
If you want to access the primary calendar of the currently logged in user, use the "primary" keyword.`,
Defaults: map[string]interface{}{"delete": "primary", "get": "primary", "insert": "primary", "list": "primary", "patch": "primary"},
Defaults: map[string]any{"delete": "primary", "get": "primary", "insert": "primary", "list": "primary", "patch": "primary"},
},
"ruleId": {
AvailableFor: []string{"delete", "get", "patch"},
Expand All @@ -60,7 +60,7 @@ If you want to access the primary calendar of the currently logged in user, use
Type: "bool",
Description: `Whether to send notifications about the calendar sharing change.
Optional. The default is True.`,
Defaults: map[string]interface{}{"insert": true, "patch": true},
Defaults: map[string]any{"insert": true, "patch": true},
},
"role": {
AvailableFor: []string{"insert", "patch"},
Expand All @@ -82,7 +82,7 @@ Optional. The default is True.`,
"group" - Limits the scope to a group.
"domain" - Limits the scope to a domain.
Note: The permissions granted to the "default", or public, scope apply to any user, authenticated or not.`,
Defaults: map[string]interface{}{"insert": "default"},
Defaults: map[string]any{"insert": "default"},
},
"scopeValue": {
AvailableFor: []string{"insert", "patch"},
Expand Down
2 changes: 1 addition & 1 deletion cmd/calendaracl_delete.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/calendaracl_delete_batch.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/calendaracl_get.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/calendaracl_get_batch.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/calendaracl_insert.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/calendaracl_insert_batch.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/calendaracl_list.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmd/calendaracl_list_batch.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2020-2021 Hannes Hayashi
Copyright © 2020-2022 Hannes Hayashi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
Loading

0 comments on commit f919624

Please sign in to comment.