# PulpcoreClient::UsersRolesApi

All URIs are relative to *https://pulp*

Method | HTTP request | Description
------------- | ------------- | -------------
[**create**](UsersRolesApi.md#create) | **POST** {auth_user_href}roles/ | Create an user role
[**delete**](UsersRolesApi.md#delete) | **DELETE** {auth_users_user_role_href} | Delete an user role
[**list**](UsersRolesApi.md#list) | **GET** {auth_user_href}roles/ | List user roles
[**read**](UsersRolesApi.md#read) | **GET** {auth_users_user_role_href} | Inspect an user role



## create

> UserRoleResponse create(auth_user_href, user_role)

Create an user role

ViewSet for UserRole.  NOTE: This API endpoint is in \"tech preview\" and subject to change

### Example

```ruby
# load the gem
require 'pulpcore_client'
# setup authorization
PulpcoreClient.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = PulpcoreClient::UsersRolesApi.new
auth_user_href = 'auth_user_href_example' # String | 
user_role = PulpcoreClient::UserRole.new # UserRole | 

begin
  #Create an user role
  result = api_instance.create(auth_user_href, user_role)
  p result
rescue PulpcoreClient::ApiError => e
  puts "Exception when calling UsersRolesApi->create: #{e}"
end
```

### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **auth_user_href** | **String**|  | 
 **user_role** | [**UserRole**](UserRole.md)|  | 

### Return type

[**UserRoleResponse**](UserRoleResponse.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
- **Accept**: application/json


## delete

> delete(auth_users_user_role_href)

Delete an user role

ViewSet for UserRole.  NOTE: This API endpoint is in \"tech preview\" and subject to change

### Example

```ruby
# load the gem
require 'pulpcore_client'
# setup authorization
PulpcoreClient.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = PulpcoreClient::UsersRolesApi.new
auth_users_user_role_href = 'auth_users_user_role_href_example' # String | 

begin
  #Delete an user role
  api_instance.delete(auth_users_user_role_href)
rescue PulpcoreClient::ApiError => e
  puts "Exception when calling UsersRolesApi->delete: #{e}"
end
```

### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **auth_users_user_role_href** | **String**|  | 

### Return type

nil (empty response body)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined


## list

> PaginatedUserRoleResponseList list(auth_user_href, opts)

List user roles

ViewSet for UserRole.  NOTE: This API endpoint is in \"tech preview\" and subject to change

### Example

```ruby
# load the gem
require 'pulpcore_client'
# setup authorization
PulpcoreClient.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = PulpcoreClient::UsersRolesApi.new
auth_user_href = 'auth_user_href_example' # String | 
opts = {
  content_object: 'content_object_example', # String | content_object
  limit: 56, # Integer | Number of results to return per page.
  offset: 56, # Integer | The initial index from which to return the results.
  ordering: 'ordering_example', # String | Which field to use when ordering the results.
  role: 'role_example', # String | 
  role__contains: 'role__contains_example', # String | 
  role__icontains: 'role__icontains_example', # String | 
  role__in: ['role__in_example'], # Array<String> | Multiple values may be separated by commas.
  role__startswith: 'role__startswith_example', # String | 
  fields: 'fields_example', # String | A list of fields to include in the response.
  exclude_fields: 'exclude_fields_example' # String | A list of fields to exclude from the response.
}

begin
  #List user roles
  result = api_instance.list(auth_user_href, opts)
  p result
rescue PulpcoreClient::ApiError => e
  puts "Exception when calling UsersRolesApi->list: #{e}"
end
```

### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **auth_user_href** | **String**|  | 
 **content_object** | **String**| content_object | [optional] 
 **limit** | **Integer**| Number of results to return per page. | [optional] 
 **offset** | **Integer**| The initial index from which to return the results. | [optional] 
 **ordering** | **String**| Which field to use when ordering the results. | [optional] 
 **role** | **String**|  | [optional] 
 **role__contains** | **String**|  | [optional] 
 **role__icontains** | **String**|  | [optional] 
 **role__in** | [**Array&lt;String&gt;**](String.md)| Multiple values may be separated by commas. | [optional] 
 **role__startswith** | **String**|  | [optional] 
 **fields** | **String**| A list of fields to include in the response. | [optional] 
 **exclude_fields** | **String**| A list of fields to exclude from the response. | [optional] 

### Return type

[**PaginatedUserRoleResponseList**](PaginatedUserRoleResponseList.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


## read

> UserRoleResponse read(auth_users_user_role_href, opts)

Inspect an user role

ViewSet for UserRole.  NOTE: This API endpoint is in \"tech preview\" and subject to change

### Example

```ruby
# load the gem
require 'pulpcore_client'
# setup authorization
PulpcoreClient.configure do |config|
  # Configure HTTP basic authorization: basicAuth
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'
end

api_instance = PulpcoreClient::UsersRolesApi.new
auth_users_user_role_href = 'auth_users_user_role_href_example' # String | 
opts = {
  fields: 'fields_example', # String | A list of fields to include in the response.
  exclude_fields: 'exclude_fields_example' # String | A list of fields to exclude from the response.
}

begin
  #Inspect an user role
  result = api_instance.read(auth_users_user_role_href, opts)
  p result
rescue PulpcoreClient::ApiError => e
  puts "Exception when calling UsersRolesApi->read: #{e}"
end
```

### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **auth_users_user_role_href** | **String**|  | 
 **fields** | **String**| A list of fields to include in the response. | [optional] 
 **exclude_fields** | **String**| A list of fields to exclude from the response. | [optional] 

### Return type

[**UserRoleResponse**](UserRoleResponse.md)

### Authorization

[basicAuth](../README.md#basicAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json