class Atrium::UsersApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# 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(body, opts = {}) click to toggle source

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(user_guid, opts = {}) click to toggle source

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(opts = {}) click to toggle source

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(user_guid, opts = {}) click to toggle source

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(user_guid, opts = {}) click to toggle source

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_with_http_info(body, opts = {}) click to toggle source

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.&lt;br&gt; 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&#39;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&#39;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_with_http_info(user_guid, opts = {}) click to toggle source

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 &#x60;user&#x60;. @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_with_http_info(opts = {}) click to toggle source

List users Use this endpoint to list every user you&#39;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_with_http_info(user_guid, opts = {}) click to toggle source

Read user Use this endpoint to read the attributes of a specific user. @param user_guid The unique identifier for a &#x60;user&#x60;. @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_with_http_info(user_guid, opts = {}) click to toggle source

Update user Use this endpoint to update the attributes of a specific user. Atrium will respond with the updated user object.&lt;br&gt; 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&#39;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&#39;s bill.&lt;br&gt; 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 &#x60;user&#x60;. @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