Skip to content

Commit

Permalink
Merge pull request Shopify#32 from FanTuanEats/feature/apps-schema
Browse files Browse the repository at this point in the history
Add App User Schema operations
  • Loading branch information
ltk authored Jan 13, 2022
2 parents c1b45ba + eb10e2d commit 38b3146
Show file tree
Hide file tree
Showing 6 changed files with 517 additions and 1 deletion.
64 changes: 64 additions & 0 deletions lib/oktakit/client/schemas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,70 @@ def update_user_profile_schema_property(options = {})
def remove_property_from_user_profile_schema(options = {})
post('/meta/schemas/user/default', options)
end

# Get App User Schema
#
# @params id [string] Application 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>] User Schema
# @see https://developer.okta.com/docs/reference/api/schemas/#get-app-user-schema
# @example
# Oktakit.get_app_user_schema('id')
def get_app_user_schema(id, options = {})
get("/meta/schemas/apps/#{id}/default", options)
end

# Add Property to App User Profile Schema
#
# @params id [string] Application 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>] User Schema
# @see https://developer.okta.com/docs/reference/api/schemas/#add-property-to-app-user-profile-schema
# @example
# Oktakit.add_property_to_app_user_profile_schema('id')
def add_property_to_app_user_profile_schema(id, options = {})
post("/meta/schemas/apps/#{id}/default", options)
end

# Update App User Profile Schema property
#
# @params id [string] Application 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>] User Schema
# @see https://developer.okta.com/docs/reference/api/schemas/#update-app-user-profile-schema-property
# @example
# Oktakit.update_app_user_profile_schema_property('id')
def update_app_user_profile_schema_property(id, options = {})
post("/meta/schemas/apps/#{id}/default", options)
end

# Remove property from App User Profile Schema
#
# @params id [string] Application 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>] User Schema
# @see https://developer.okta.com/docs/reference/api/schemas/#remove-property-from-app-user-profile-schema
# @example
# Oktakit.remove_property_from_app_user_profile_schema('id')
def remove_property_from_app_user_profile_schema(id, options = {})
post("/meta/schemas/apps/#{id}/default", options)
end
end
end
end
89 changes: 89 additions & 0 deletions spec/cassettes/add_property_to_app_user_profile_schema.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions spec/cassettes/get_app_user_schema.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 38b3146

Please sign in to comment.