class PulpcoreClient::UsersApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/pulpcore_client/api/users_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create(user, opts = {}) click to toggle source

Create an user ViewSet for User. @param user [User] @param [Hash] opts the optional parameters @return [UserResponse]

# File lib/pulpcore_client/api/users_api.rb, line 27
def create(user, opts = {})
  data, _status_code, _headers = create_with_http_info(user, opts)
  data
end
create_with_http_info(user, opts = {}) click to toggle source

Create an user ViewSet for User. @param user [User] @param [Hash] opts the optional parameters @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers

# File lib/pulpcore_client/api/users_api.rb, line 37
def create_with_http_info(user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.create ...'
  end
  # verify the required parameter 'user' is set
  if @api_client.config.client_side_validation && user.nil?
    fail ArgumentError, "Missing the required parameter 'user' when calling UsersApi.create"
  end
  # resource path
  local_var_path = '/pulp/api/v3/users/'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(user) 

  # return_type
  return_type = opts[:return_type] || 'UserResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete(auth_user_href, opts = {}) click to toggle source

Delete an user ViewSet for User. @param auth_user_href [String] @param [Hash] opts the optional parameters @return [nil]

# File lib/pulpcore_client/api/users_api.rb, line 91
def delete(auth_user_href, opts = {})
  delete_with_http_info(auth_user_href, opts)
  nil
end
delete_with_http_info(auth_user_href, opts = {}) click to toggle source

Delete an user ViewSet for User. @param auth_user_href [String] @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pulpcore_client/api/users_api.rb, line 101
def delete_with_http_info(auth_user_href, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.delete ...'
  end
  # verify the required parameter 'auth_user_href' is set
  if @api_client.config.client_side_validation && auth_user_href.nil?
    fail ArgumentError, "Missing the required parameter 'auth_user_href' when calling UsersApi.delete"
  end
  # resource path
  local_var_path = '{auth_user_href}'.sub('{' + 'auth_user_href' + '}', CGI.escape(auth_user_href.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list(opts = {}) click to toggle source

List users ViewSet for User. @param [Hash] opts the optional parameters @option opts [String] :email Filter results where email matches value @option opts [String] :email__contains Filter results where email contains value @option opts [String] :email__icontains Filter results where email contains value @option opts [String] :email__iexact Filter results where email matches value @option opts [Array<String>] :email__in Filter results where email is in a comma-separated list of values @option opts [String] :first_name Filter results where first_name matches value @option opts [String] :first_name__contains Filter results where first_name contains value @option opts [String] :first_name__icontains Filter results where first_name contains value @option opts [String] :first_name__iexact Filter results where first_name matches value @option opts [Array<String>] :first_name__in Filter results where first_name is in a comma-separated list of values @option opts [Boolean] :is_active Filter results where is_active matches value @option opts [Boolean] :is_staff Filter results where is_staff matches value @option opts [String] :last_name Filter results where last_name matches value @option opts [String] :last_name__contains Filter results where last_name contains value @option opts [String] :last_name__icontains Filter results where last_name contains value @option opts [String] :last_name__iexact Filter results where last_name matches value @option opts [Array<String>] :last_name__in Filter results where last_name is in a comma-separated list of values @option opts [Integer] :limit Number of results to return per page. @option opts [Integer] :offset The initial index from which to return the results. @option opts [Array<String>] :ordering Ordering * &#x60;id&#x60; - Id * &#x60;-id&#x60; - Id (descending) * &#x60;password&#x60; - Password * &#x60;-password&#x60; - Password (descending) * &#x60;last_login&#x60; - Last login * &#x60;-last_login&#x60; - Last login (descending) * &#x60;is_superuser&#x60; - Is superuser * &#x60;-is_superuser&#x60; - Is superuser (descending) * &#x60;username&#x60; - Username * &#x60;-username&#x60; - Username (descending) * &#x60;first_name&#x60; - First name * &#x60;-first_name&#x60; - First name (descending) * &#x60;last_name&#x60; - Last name * &#x60;-last_name&#x60; - Last name (descending) * &#x60;email&#x60; - Email * &#x60;-email&#x60; - Email (descending) * &#x60;is_staff&#x60; - Is staff * &#x60;-is_staff&#x60; - Is staff (descending) * &#x60;is_active&#x60; - Is active * &#x60;-is_active&#x60; - Is active (descending) * &#x60;date_joined&#x60; - Date joined * &#x60;-date_joined&#x60; - Date joined (descending) * &#x60;pk&#x60; - Pk * &#x60;-pk&#x60; - Pk (descending) @option opts [Array<String>] :pulp_href__in Multiple values may be separated by commas. @option opts [Array<String>] :pulp_id__in Multiple values may be separated by commas. @option opts [String] :q @option opts [String] :username Filter results where username matches value @option opts [String] :username__contains Filter results where username contains value @option opts [String] :username__icontains Filter results where username contains value @option opts [String] :username__iexact Filter results where username matches value @option opts [Array<String>] :username__in Filter results where username is in a comma-separated list of values @option opts [Array<String>] :fields A list of fields to include in the response. @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response. @return [PaginatedUserResponseList]

# File lib/pulpcore_client/api/users_api.rb, line 180
def list(opts = {})
  data, _status_code, _headers = list_with_http_info(opts)
  data
end
list_with_http_info(opts = {}) click to toggle source

List users ViewSet for User. @param [Hash] opts the optional parameters @option opts [String] :email Filter results where email matches value @option opts [String] :email__contains Filter results where email contains value @option opts [String] :email__icontains Filter results where email contains value @option opts [String] :email__iexact Filter results where email matches value @option opts [Array<String>] :email__in Filter results where email is in a comma-separated list of values @option opts [String] :first_name Filter results where first_name matches value @option opts [String] :first_name__contains Filter results where first_name contains value @option opts [String] :first_name__icontains Filter results where first_name contains value @option opts [String] :first_name__iexact Filter results where first_name matches value @option opts [Array<String>] :first_name__in Filter results where first_name is in a comma-separated list of values @option opts [Boolean] :is_active Filter results where is_active matches value @option opts [Boolean] :is_staff Filter results where is_staff matches value @option opts [String] :last_name Filter results where last_name matches value @option opts [String] :last_name__contains Filter results where last_name contains value @option opts [String] :last_name__icontains Filter results where last_name contains value @option opts [String] :last_name__iexact Filter results where last_name matches value @option opts [Array<String>] :last_name__in Filter results where last_name is in a comma-separated list of values @option opts [Integer] :limit Number of results to return per page. @option opts [Integer] :offset The initial index from which to return the results. @option opts [Array<String>] :ordering Ordering * &#x60;id&#x60; - Id * &#x60;-id&#x60; - Id (descending) * &#x60;password&#x60; - Password * &#x60;-password&#x60; - Password (descending) * &#x60;last_login&#x60; - Last login * &#x60;-last_login&#x60; - Last login (descending) * &#x60;is_superuser&#x60; - Is superuser * &#x60;-is_superuser&#x60; - Is superuser (descending) * &#x60;username&#x60; - Username * &#x60;-username&#x60; - Username (descending) * &#x60;first_name&#x60; - First name * &#x60;-first_name&#x60; - First name (descending) * &#x60;last_name&#x60; - Last name * &#x60;-last_name&#x60; - Last name (descending) * &#x60;email&#x60; - Email * &#x60;-email&#x60; - Email (descending) * &#x60;is_staff&#x60; - Is staff * &#x60;-is_staff&#x60; - Is staff (descending) * &#x60;is_active&#x60; - Is active * &#x60;-is_active&#x60; - Is active (descending) * &#x60;date_joined&#x60; - Date joined * &#x60;-date_joined&#x60; - Date joined (descending) * &#x60;pk&#x60; - Pk * &#x60;-pk&#x60; - Pk (descending) @option opts [Array<String>] :pulp_href__in Multiple values may be separated by commas. @option opts [Array<String>] :pulp_id__in Multiple values may be separated by commas. @option opts [String] :q @option opts [String] :username Filter results where username matches value @option opts [String] :username__contains Filter results where username contains value @option opts [String] :username__icontains Filter results where username contains value @option opts [String] :username__iexact Filter results where username matches value @option opts [Array<String>] :username__in Filter results where username is in a comma-separated list of values @option opts [Array<String>] :fields A list of fields to include in the response. @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response. @return [Array<(PaginatedUserResponseList, Integer, Hash)>] PaginatedUserResponseList data, response status code and response headers

# File lib/pulpcore_client/api/users_api.rb, line 219
def list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.list ...'
  end
  allowable_values = ["-date_joined", "-email", "-first_name", "-id", "-is_active", "-is_staff", "-is_superuser", "-last_login", "-last_name", "-password", "-pk", "-username", "date_joined", "email", "first_name", "id", "is_active", "is_staff", "is_superuser", "last_login", "last_name", "password", "pk", "username"]
  if @api_client.config.client_side_validation && opts[:'ordering'] && !opts[:'ordering'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"ordering\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/pulp/api/v3/users/'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil?
  query_params[:'email__contains'] = opts[:'email__contains'] if !opts[:'email__contains'].nil?
  query_params[:'email__icontains'] = opts[:'email__icontains'] if !opts[:'email__icontains'].nil?
  query_params[:'email__iexact'] = opts[:'email__iexact'] if !opts[:'email__iexact'].nil?
  query_params[:'email__in'] = @api_client.build_collection_param(opts[:'email__in'], :csv) if !opts[:'email__in'].nil?
  query_params[:'first_name'] = opts[:'first_name'] if !opts[:'first_name'].nil?
  query_params[:'first_name__contains'] = opts[:'first_name__contains'] if !opts[:'first_name__contains'].nil?
  query_params[:'first_name__icontains'] = opts[:'first_name__icontains'] if !opts[:'first_name__icontains'].nil?
  query_params[:'first_name__iexact'] = opts[:'first_name__iexact'] if !opts[:'first_name__iexact'].nil?
  query_params[:'first_name__in'] = @api_client.build_collection_param(opts[:'first_name__in'], :csv) if !opts[:'first_name__in'].nil?
  query_params[:'is_active'] = opts[:'is_active'] if !opts[:'is_active'].nil?
  query_params[:'is_staff'] = opts[:'is_staff'] if !opts[:'is_staff'].nil?
  query_params[:'last_name'] = opts[:'last_name'] if !opts[:'last_name'].nil?
  query_params[:'last_name__contains'] = opts[:'last_name__contains'] if !opts[:'last_name__contains'].nil?
  query_params[:'last_name__icontains'] = opts[:'last_name__icontains'] if !opts[:'last_name__icontains'].nil?
  query_params[:'last_name__iexact'] = opts[:'last_name__iexact'] if !opts[:'last_name__iexact'].nil?
  query_params[:'last_name__in'] = @api_client.build_collection_param(opts[:'last_name__in'], :csv) if !opts[:'last_name__in'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'ordering'] = @api_client.build_collection_param(opts[:'ordering'], :csv) if !opts[:'ordering'].nil?
  query_params[:'pulp_href__in'] = @api_client.build_collection_param(opts[:'pulp_href__in'], :csv) if !opts[:'pulp_href__in'].nil?
  query_params[:'pulp_id__in'] = @api_client.build_collection_param(opts[:'pulp_id__in'], :csv) if !opts[:'pulp_id__in'].nil?
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'username'] = opts[:'username'] if !opts[:'username'].nil?
  query_params[:'username__contains'] = opts[:'username__contains'] if !opts[:'username__contains'].nil?
  query_params[:'username__icontains'] = opts[:'username__icontains'] if !opts[:'username__icontains'].nil?
  query_params[:'username__iexact'] = opts[:'username__iexact'] if !opts[:'username__iexact'].nil?
  query_params[:'username__in'] = @api_client.build_collection_param(opts[:'username__in'], :csv) if !opts[:'username__in'].nil?
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :multi) if !opts[:'exclude_fields'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'PaginatedUserResponseList' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
partial_update(auth_user_href, patched_user, opts = {}) click to toggle source

Update an user ViewSet for User. @param auth_user_href [String] @param patched_user [PatchedUser] @param [Hash] opts the optional parameters @return [UserResponse]

# File lib/pulpcore_client/api/users_api.rb, line 302
def partial_update(auth_user_href, patched_user, opts = {})
  data, _status_code, _headers = partial_update_with_http_info(auth_user_href, patched_user, opts)
  data
end
partial_update_with_http_info(auth_user_href, patched_user, opts = {}) click to toggle source

Update an user ViewSet for User. @param auth_user_href [String] @param patched_user [PatchedUser] @param [Hash] opts the optional parameters @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers

# File lib/pulpcore_client/api/users_api.rb, line 313
def partial_update_with_http_info(auth_user_href, patched_user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.partial_update ...'
  end
  # verify the required parameter 'auth_user_href' is set
  if @api_client.config.client_side_validation && auth_user_href.nil?
    fail ArgumentError, "Missing the required parameter 'auth_user_href' when calling UsersApi.partial_update"
  end
  # verify the required parameter 'patched_user' is set
  if @api_client.config.client_side_validation && patched_user.nil?
    fail ArgumentError, "Missing the required parameter 'patched_user' when calling UsersApi.partial_update"
  end
  # resource path
  local_var_path = '{auth_user_href}'.sub('{' + 'auth_user_href' + '}', CGI.escape(auth_user_href.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(patched_user) 

  # return_type
  return_type = opts[:return_type] || 'UserResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#partial_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
read(auth_user_href, opts = {}) click to toggle source

Inspect an user ViewSet for User. @param auth_user_href [String] @param [Hash] opts the optional parameters @option opts [Array<String>] :fields A list of fields to include in the response. @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response. @return [UserResponse]

# File lib/pulpcore_client/api/users_api.rb, line 373
def read(auth_user_href, opts = {})
  data, _status_code, _headers = read_with_http_info(auth_user_href, opts)
  data
end
read_with_http_info(auth_user_href, opts = {}) click to toggle source

Inspect an user ViewSet for User. @param auth_user_href [String] @param [Hash] opts the optional parameters @option opts [Array<String>] :fields A list of fields to include in the response. @option opts [Array<String>] :exclude_fields A list of fields to exclude from the response. @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers

# File lib/pulpcore_client/api/users_api.rb, line 385
def read_with_http_info(auth_user_href, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.read ...'
  end
  # verify the required parameter 'auth_user_href' is set
  if @api_client.config.client_side_validation && auth_user_href.nil?
    fail ArgumentError, "Missing the required parameter 'auth_user_href' when calling UsersApi.read"
  end
  # resource path
  local_var_path = '{auth_user_href}'.sub('{' + 'auth_user_href' + '}', CGI.escape(auth_user_href.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :multi) if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :multi) if !opts[:'exclude_fields'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'UserResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update(auth_user_href, user, opts = {}) click to toggle source

Update an user ViewSet for User. @param auth_user_href [String] @param user [User] @param [Hash] opts the optional parameters @return [UserResponse]

# File lib/pulpcore_client/api/users_api.rb, line 440
def update(auth_user_href, user, opts = {})
  data, _status_code, _headers = update_with_http_info(auth_user_href, user, opts)
  data
end
update_with_http_info(auth_user_href, user, opts = {}) click to toggle source

Update an user ViewSet for User. @param auth_user_href [String] @param user [User] @param [Hash] opts the optional parameters @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers

# File lib/pulpcore_client/api/users_api.rb, line 451
def update_with_http_info(auth_user_href, user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.update ...'
  end
  # verify the required parameter 'auth_user_href' is set
  if @api_client.config.client_side_validation && auth_user_href.nil?
    fail ArgumentError, "Missing the required parameter 'auth_user_href' when calling UsersApi.update"
  end
  # verify the required parameter 'user' is set
  if @api_client.config.client_side_validation && user.nil?
    fail ArgumentError, "Missing the required parameter 'user' when calling UsersApi.update"
  end
  # resource path
  local_var_path = '{auth_user_href}'.sub('{' + 'auth_user_href' + '}', CGI.escape(auth_user_href.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(user) 

  # return_type
  return_type = opts[:return_type] || 'UserResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsersApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end