-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GET /organization/:orgId/roles support. (#388)
- Loading branch information
Showing
6 changed files
with
255 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# roles | ||
|
||
[![Go Report Card](https://img.shields.io/badge/dev-reference-007d9c?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/workos/workos-go/v4/pkg/roles) | ||
|
||
A Go package to make requests to the WorkOS Roles API. | ||
|
||
## Install | ||
|
||
```sh | ||
go get -u github.com/workos/workos-go/v4/pkg/roles | ||
``` | ||
|
||
## How it works | ||
|
||
See the [Roles API reference](https://workos.com/docs/reference/roles). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package roles | ||
|
||
// RoleType represents the type of a Role. | ||
type RoleType string | ||
|
||
// Constants that enumerate the type of a Role. | ||
const ( | ||
Environment RoleType = "EnvironmentRole" | ||
Organization RoleType = "OrganizationRole" | ||
) | ||
|
||
// Role contains data about a WorkOS Role. | ||
type Role struct { | ||
// The Role's unique identifier. | ||
ID string `json:"id"` | ||
|
||
Name string `json:"name"` | ||
|
||
// The Role's slug key for referencing it in code. | ||
Slug string `json:"slug"` | ||
|
||
Description string `json:"description"` | ||
|
||
// The type of role | ||
Type RoleType `json:"type"` | ||
|
||
// The timestamp of when the Role was created. | ||
CreatedAt string `json:"created_at"` | ||
|
||
// The timestamp of when the Role was updated. | ||
UpdatedAt string `json:"updated_at"` | ||
} |