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. NOTE: This API endpoint is in "tech preview" and subject to change @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. NOTE: This API endpoint is in "tech preview&quot; and subject to change @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. NOTE: This API endpoint is in "tech preview" and subject to change @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. NOTE: This API endpoint is in "tech preview&quot; and subject to change @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. NOTE: This API endpoint is in "tech preview" and subject to change @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 [String] :ordering Which field to use when ordering the results. @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 [String] :fields A list of fields to include in the response. @option opts [String] :exclude_fields A list of fields to exclude from the response. @return [PaginatedUserResponseList]

# File lib/pulpcore_client/api/users_api.rb, line 177
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. NOTE: This API endpoint is in "tech preview&quot; and subject to change @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 [String] :ordering Which field to use when ordering the results. @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 [String] :fields A list of fields to include in the response. @option opts [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 213
def list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.list ...'
  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'] = opts[:'ordering'] if !opts[:'ordering'].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'] = opts[:'fields'] if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = opts[:'exclude_fields'] 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. NOTE: This API endpoint is in "tech preview" and subject to change @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 289
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. NOTE: This API endpoint is in "tech preview&quot; and subject to change @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 300
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
permissions(auth_user_href, opts = {}) click to toggle source

List user permissions. @param auth_user_href [String] @param [Hash] opts the optional parameters @option opts [String] :fields A list of fields to include in the response. @option opts [String] :exclude_fields A list of fields to exclude from the response. @return [PermissionResponse]

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

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

# File lib/pulpcore_client/api/users_api.rb, line 370
def permissions_with_http_info(auth_user_href, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsersApi.permissions ...'
  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.permissions"
  end
  # resource path
  local_var_path = '{auth_user_href}permissions/'.sub('{' + 'auth_user_href' + '}', CGI.escape(auth_user_href.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = opts[:'exclude_fields'] 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] || 'PermissionResponse' 

  # 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#permissions\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. NOTE: This API endpoint is in "tech preview" and subject to change @param auth_user_href [String] @param [Hash] opts the optional parameters @option opts [String] :fields A list of fields to include in the response. @option opts [String] :exclude_fields A list of fields to exclude from the response. @return [UserResponse]

# File lib/pulpcore_client/api/users_api.rb, line 426
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. NOTE: This API endpoint is in "tech preview&quot; and subject to change @param auth_user_href [String] @param [Hash] opts the optional parameters @option opts [String] :fields A list of fields to include in the response. @option opts [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 438
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'] = opts[:'fields'] if !opts[:'fields'].nil?
  query_params[:'exclude_fields'] = opts[:'exclude_fields'] 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. NOTE: This API endpoint is in "tech preview" and subject to change @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 493
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. NOTE: This API endpoint is in "tech preview&quot; and subject to change @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 504
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