forked from Shopify/oktakit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Shopify#44 from Shopify/ltk/add-group-rules
Add support for group rule operations
- Loading branch information
Showing
12 changed files
with
529 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Changelog | ||
|
||
## [v0.2.1] - 2021-10-14 | ||
- Adds support for [Group Rule operations](https://developer.okta.com/docs/reference/api/groups/#group-rule-operations) |
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,115 @@ | ||
module Oktakit | ||
class Client | ||
module GroupRules | ||
# Add Group Rule | ||
# | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return [Hash<Sawyer::Resource>] The created Group Rule. | ||
# @see https://developer.okta.com/docs/reference/api/groups/#create-group-rule | ||
# @example | ||
# Oktakit.add_group_rule | ||
def add_group_rule(options = {}) | ||
post('/groups/rules', options) | ||
end | ||
|
||
# Get Group Rule | ||
# | ||
# @params id [string] Group Rule ID | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return [Hash<Sawyer::Resource>] Fetched Group Rule | ||
# @see https://developer.okta.com/docs/reference/api/groups/#get-group-rule | ||
# @example | ||
# Oktakit.get_group_rule('id') | ||
def get_group_rule(id, options = {}) | ||
get("/groups/rules/#{id}", options) | ||
end | ||
|
||
# List Group Rules | ||
# | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return [Array<Sawyer::Resource>] Array of Group Rules | ||
# @see https://developer.okta.com/docs/reference/api/groups/#list-group-rules | ||
# @example | ||
# Oktakit.list_group_rules | ||
def list_group_rules(options = {}) | ||
get('/groups/rules', options) | ||
end | ||
|
||
# Update Group Rule | ||
# | ||
# @params id [string] Group Rule ID | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return [Hash<Sawyer::Resource>] Updated Group Rule | ||
# @see https://developer.okta.com/docs/reference/api/groups/#update-group-rule | ||
# @example | ||
# Oktakit.update_group_rule('id') | ||
def update_group_rule(id, options = {}) | ||
put("/groups/rules/#{id}", options) | ||
end | ||
|
||
# Remove Group Rule | ||
# | ||
# @params id [string] Group ID | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return HTTP 202 Accepted | ||
# @see https://developer.okta.com/docs/reference/api/groups/#delete-a-group-rule | ||
# @example | ||
# Oktakit.remove_group_rule('id') | ||
def remove_group_rule(id, options = {}) | ||
delete("/groups/rules/#{id}", options) | ||
end | ||
|
||
# Activate Group Rule | ||
# | ||
# @params id [string] Group ID | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return HTTP 204 No Content | ||
# @see https://developer.okta.com/docs/reference/api/groups/#activate-a-group-rule | ||
# @example | ||
# Oktakit.activate_group_rule('id') | ||
def activate_group_rule(id, options = {}) | ||
post("/groups/rules/#{id}/lifecycle/activate", options) | ||
end | ||
|
||
# Deactivate Group Rule | ||
# | ||
# @params id [string] Group ID | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return HTTP 204 No Content | ||
# @see https://developer.okta.com/docs/reference/api/groups/#deactivate-a-group-rule | ||
# @example | ||
# Oktakit.deactivate_group_rule('id') | ||
def deactivate_group_rule(id, options = {}) | ||
post("/groups/rules/#{id}/lifecycle/deactivate", options) | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Oktakit | ||
VERSION = '0.2.0'.freeze | ||
VERSION = '0.2.1'.freeze | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.