class Atrium::UsersApi
Attributes
Public Class Methods
# File lib/atrium-ruby/api/users_api.rb, line 15 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Create user Call this endpoint to create a new user. Atrium
will respond with the newly-created user object if successful. This endpoint accepts several parameters: identifier, metadata, and is_disabled.
Disabling a user means that accounts and transactions associated with it will not be updated in the background by MX. It will also restrict access to that user's data until they are no longer disabled. Users who are disabled for the entirety of an Atrium
billing period will not be factored into that month's bill. @param body User
object to be created with optional parameters (identifier, is_disabled, metadata) @param [Hash] opts the optional parameters @return [UserResponseBody]
# File lib/atrium-ruby/api/users_api.rb, line 23 def create_user(body, opts = {}) data, _status_code, _headers = create_user_with_http_info(body, opts) data end
Delete user Calling this endpoint will permanently delete a user from Atrium
. If successful, the API will respond with Status: 204 No Content. @param user_guid The unique identifier for a `user`. @param [Hash] opts the optional parameters @return [nil]
# File lib/atrium-ruby/api/users_api.rb, line 33 def delete_user(user_guid, opts = {}) delete_user_with_http_info(user_guid, opts) nil end
List users Use this endpoint to list every user you've created in Atrium
. @param [Hash] opts the optional parameters @option opts [Integer] :page Specify current page. @option opts [Integer] :records_per_page Specify records per page. @return [UsersResponseBody]
# File lib/atrium-ruby/api/users_api.rb, line 44 def list_users(opts = {}) data, _status_code, _headers = list_users_with_http_info(opts) data end
Read user Use this endpoint to read the attributes of a specific user. @param user_guid The unique identifier for a `user`. @param [Hash] opts the optional parameters @return [UserResponseBody]
# File lib/atrium-ruby/api/users_api.rb, line 54 def read_user(user_guid, opts = {}) data, _status_code, _headers = read_user_with_http_info(user_guid, opts) data end
Update user Use this endpoint to update the attributes of a specific user. Atrium
will respond with the updated user object.
Disabling a user means that accounts and transactions associated with it will not be updated in the background by MX. It will also restrict access to that user's data until they are no longer disabled. Users who are disabled for the entirety of an Atrium
billing period will not be factored into that month's bill.
To disable a user, update it and set the is_disabled parameter to true. Set it to false to re-enable the user. @param user_guid The unique identifier for a `user`. @param [Hash] opts the optional parameters @option opts [UserUpdateRequestBody] :body User
object to be updated with optional parameters (identifier, is_disabled, metadata) @return [UserResponseBody]
# File lib/atrium-ruby/api/users_api.rb, line 65 def update_user(user_guid, opts = {}) data, _status_code, _headers = update_user_with_http_info(user_guid, opts) data end
Private Instance Methods
Create user Call this endpoint to create a new user. Atrium
will respond with the newly-created user object if successful. This endpoint accepts several parameters: identifier, metadata, and is_disabled.<br> Disabling a user means that accounts and transactions associated with it will not be updated in the background by MX. It will also restrict access to that user's data until they are no longer disabled. Users who are disabled for the entirety of an Atrium
billing period will not be factored into that month's bill. @param body User
object to be created with optional parameters (identifier, is_disabled, metadata) @param [Hash] opts the optional parameters @return [Array<(UserResponseBody
, Fixnum, Hash)>] UserResponseBody
data, response status code and response headers
# File lib/atrium-ruby/api/users_api.rb, line 78 def create_user_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.create_user ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.create_user" end # resource path local_var_path = '/users' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['apiKey', 'clientID'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserResponseBody') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete user Calling this endpoint will permanently delete a user from Atrium
. If successful, the API will respond with Status: 204 No Content. @param user_guid The unique identifier for a `user`. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/atrium-ruby/api/users_api.rb, line 122 def delete_user_with_http_info(user_guid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.delete_user ...' end # verify the required parameter 'user_guid' is set if @api_client.config.client_side_validation && user_guid.nil? fail ArgumentError, "Missing the required parameter 'user_guid' when calling UsersApi.delete_user" end # resource path local_var_path = '/users/{user_guid}'.sub('{' + 'user_guid' + '}', user_guid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['apiKey', 'clientID'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List users Use this endpoint to list every user you've created in Atrium
. @param [Hash] opts the optional parameters @option opts [Integer] :page Specify current page. @option opts [Integer] :records_per_page Specify records per page. @return [Array<(UsersResponseBody
, Fixnum, Hash)>] UsersResponseBody
data, response status code and response headers
# File lib/atrium-ruby/api/users_api.rb, line 164 def list_users_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.list_users ...' end # resource path local_var_path = '/users' # query parameters query_params = {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'records_per_page'] = opts[:'records_per_page'] if !opts[:'records_per_page'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['apiKey', 'clientID'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UsersResponseBody') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#list_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Read user Use this endpoint to read the attributes of a specific user. @param user_guid The unique identifier for a `user`. @param [Hash] opts the optional parameters @return [Array<(UserResponseBody
, Fixnum, Hash)>] UserResponseBody
data, response status code and response headers
# File lib/atrium-ruby/api/users_api.rb, line 204 def read_user_with_http_info(user_guid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.read_user ...' end # verify the required parameter 'user_guid' is set if @api_client.config.client_side_validation && user_guid.nil? fail ArgumentError, "Missing the required parameter 'user_guid' when calling UsersApi.read_user" end # resource path local_var_path = '/users/{user_guid}'.sub('{' + 'user_guid' + '}', user_guid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['apiKey', 'clientID'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserResponseBody') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#read_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update user Use this endpoint to update the attributes of a specific user. Atrium
will respond with the updated user object.<br> Disabling a user means that accounts and transactions associated with it will not be updated in the background by MX. It will also restrict access to that user's data until they are no longer disabled. Users who are disabled for the entirety of an Atrium
billing period will not be factored into that month's bill.<br> To disable a user, update it and set the is_disabled parameter to true. Set it to false to re-enable the user. @param user_guid The unique identifier for a `user`. @param [Hash] opts the optional parameters @option opts [UserUpdateRequestBody] :body User
object to be updated with optional parameters (identifier, is_disabled, metadata) @return [Array<(UserResponseBody
, Fixnum, Hash)>] UserResponseBody
data, response status code and response headers
# File lib/atrium-ruby/api/users_api.rb, line 247 def update_user_with_http_info(user_guid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.update_user ...' end # verify the required parameter 'user_guid' is set if @api_client.config.client_side_validation && user_guid.nil? fail ArgumentError, "Missing the required parameter 'user_guid' when calling UsersApi.update_user" end # resource path local_var_path = '/users/{user_guid}'.sub('{' + 'user_guid' + '}', user_guid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.atrium.v1+json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['apiKey', 'clientID'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserResponseBody') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end