-
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 (#338)
- Loading branch information
Showing
5 changed files
with
163 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
module WorkOS | ||
# The Role class provides a lightweight wrapper around | ||
# a WorkOS Role resource. This class is not meant to be instantiated | ||
# in user space, and is instantiated internally but exposed. | ||
class Role | ||
include HashProvider | ||
|
||
attr_accessor :id, :name, :slug, :description, :type, :created_at, :updated_at | ||
|
||
def initialize(json) | ||
hash = JSON.parse(json, symbolize_names: true) | ||
|
||
@id = hash[:id] | ||
@name = hash[:name] | ||
@slug = hash[:slug] | ||
@description = hash[:description] | ||
@type = hash[:type] | ||
@created_at = hash[:created_at] | ||
@updated_at = hash[:updated_at] | ||
end | ||
|
||
def to_json(*) | ||
{ | ||
id: id, | ||
name: name, | ||
slug: slug, | ||
description: description, | ||
type: type, | ||
created_at: created_at, | ||
updated_at: updated_at, | ||
} | ||
end | ||
end | ||
end |
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
82 changes: 82 additions & 0 deletions
82
spec/support/fixtures/vcr_cassettes/organization/list_organization_roles.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.