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

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 53
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 89
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
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 165
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 176
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 232
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 244
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