# PackageApi

All URIs are relative to */api/v1*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**deletePackage**](#deletepackage) | **DELETE** /packages/{owner}/{type}/{name}/{version} | Delete a package|
|[**getPackage**](#getpackage) | **GET** /packages/{owner}/{type}/{name}/{version} | Gets a package|
|[**linkPackage**](#linkpackage) | **POST** /packages/{owner}/{type}/{name}/-/link/{repo_name} | Link a package to a repository|
|[**listPackageFiles**](#listpackagefiles) | **GET** /packages/{owner}/{type}/{name}/{version}/files | Gets all files of a package|
|[**listPackages**](#listpackages) | **GET** /packages/{owner} | Gets all packages of an owner|
|[**unlinkPackage**](#unlinkpackage) | **POST** /packages/{owner}/{type}/{name}/-/unlink | Unlink a package from a repository|

# **deletePackage**
> deletePackage()


### Example

```typescript
import {
    PackageApi,
    Configuration
} from 'berg';

const configuration = new Configuration();
const apiInstance = new PackageApi(configuration);

let owner: string; //owner of the package (default to undefined)
let type: string; //type of the package (default to undefined)
let name: string; //name of the package (default to undefined)
let version: string; //version of the package (default to undefined)

const { status, data } = await apiInstance.deletePackage(
    owner,
    type,
    name,
    version
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **owner** | [**string**] | owner of the package | defaults to undefined|
| **type** | [**string**] | type of the package | defaults to undefined|
| **name** | [**string**] | name of the package | defaults to undefined|
| **version** | [**string**] | version of the package | defaults to undefined|


### Return type

void (empty response body)

### Authorization

[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json, text/html


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | APIEmpty is an empty response |  -  |
|**404** | APINotFound is a not found error response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getPackage**
> Package getPackage()


### Example

```typescript
import {
    PackageApi,
    Configuration
} from 'berg';

const configuration = new Configuration();
const apiInstance = new PackageApi(configuration);

let owner: string; //owner of the package (default to undefined)
let type: string; //type of the package (default to undefined)
let name: string; //name of the package (default to undefined)
let version: string; //version of the package (default to undefined)

const { status, data } = await apiInstance.getPackage(
    owner,
    type,
    name,
    version
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **owner** | [**string**] | owner of the package | defaults to undefined|
| **type** | [**string**] | type of the package | defaults to undefined|
| **name** | [**string**] | name of the package | defaults to undefined|
| **version** | [**string**] | version of the package | defaults to undefined|


### Return type

**Package**

### Authorization

[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Package |  -  |
|**404** | APINotFound is a not found error response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **linkPackage**
> linkPackage()


### Example

```typescript
import {
    PackageApi,
    Configuration
} from 'berg';

const configuration = new Configuration();
const apiInstance = new PackageApi(configuration);

let owner: string; //owner of the package (default to undefined)
let type: string; //type of the package (default to undefined)
let name: string; //name of the package (default to undefined)
let repoName: string; //name of the repository to link. (default to undefined)

const { status, data } = await apiInstance.linkPackage(
    owner,
    type,
    name,
    repoName
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **owner** | [**string**] | owner of the package | defaults to undefined|
| **type** | [**string**] | type of the package | defaults to undefined|
| **name** | [**string**] | name of the package | defaults to undefined|
| **repoName** | [**string**] | name of the repository to link. | defaults to undefined|


### Return type

void (empty response body)

### Authorization

[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json, text/html


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**201** | APIEmpty is an empty response |  -  |
|**404** | APINotFound is a not found error response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **listPackageFiles**
> Array<PackageFile> listPackageFiles()


### Example

```typescript
import {
    PackageApi,
    Configuration
} from 'berg';

const configuration = new Configuration();
const apiInstance = new PackageApi(configuration);

let owner: string; //owner of the package (default to undefined)
let type: string; //type of the package (default to undefined)
let name: string; //name of the package (default to undefined)
let version: string; //version of the package (default to undefined)

const { status, data } = await apiInstance.listPackageFiles(
    owner,
    type,
    name,
    version
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **owner** | [**string**] | owner of the package | defaults to undefined|
| **type** | [**string**] | type of the package | defaults to undefined|
| **name** | [**string**] | name of the package | defaults to undefined|
| **version** | [**string**] | version of the package | defaults to undefined|


### Return type

**Array<PackageFile>**

### Authorization

[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | PackageFileList |  -  |
|**404** | APINotFound is a not found error response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **listPackages**
> Array<Package> listPackages()


### Example

```typescript
import {
    PackageApi,
    Configuration
} from 'berg';

const configuration = new Configuration();
const apiInstance = new PackageApi(configuration);

let owner: string; //owner of the packages (default to undefined)
let page: number; //page number of results to return (1-based) (optional) (default to undefined)
let limit: number; //page size of results (optional) (default to undefined)
let type: 'alpine' | 'cargo' | 'chef' | 'composer' | 'conan' | 'conda' | 'container' | 'cran' | 'debian' | 'generic' | 'go' | 'helm' | 'maven' | 'npm' | 'nuget' | 'pub' | 'pypi' | 'rpm' | 'rubygems' | 'swift' | 'vagrant'; //package type filter (optional) (default to undefined)
let q: string; //name filter (optional) (default to undefined)

const { status, data } = await apiInstance.listPackages(
    owner,
    page,
    limit,
    type,
    q
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **owner** | [**string**] | owner of the packages | defaults to undefined|
| **page** | [**number**] | page number of results to return (1-based) | (optional) defaults to undefined|
| **limit** | [**number**] | page size of results | (optional) defaults to undefined|
| **type** | [**&#39;alpine&#39; | &#39;cargo&#39; | &#39;chef&#39; | &#39;composer&#39; | &#39;conan&#39; | &#39;conda&#39; | &#39;container&#39; | &#39;cran&#39; | &#39;debian&#39; | &#39;generic&#39; | &#39;go&#39; | &#39;helm&#39; | &#39;maven&#39; | &#39;npm&#39; | &#39;nuget&#39; | &#39;pub&#39; | &#39;pypi&#39; | &#39;rpm&#39; | &#39;rubygems&#39; | &#39;swift&#39; | &#39;vagrant&#39;**]**Array<&#39;alpine&#39; &#124; &#39;cargo&#39; &#124; &#39;chef&#39; &#124; &#39;composer&#39; &#124; &#39;conan&#39; &#124; &#39;conda&#39; &#124; &#39;container&#39; &#124; &#39;cran&#39; &#124; &#39;debian&#39; &#124; &#39;generic&#39; &#124; &#39;go&#39; &#124; &#39;helm&#39; &#124; &#39;maven&#39; &#124; &#39;npm&#39; &#124; &#39;nuget&#39; &#124; &#39;pub&#39; &#124; &#39;pypi&#39; &#124; &#39;rpm&#39; &#124; &#39;rubygems&#39; &#124; &#39;swift&#39; &#124; &#39;vagrant&#39;>** | package type filter | (optional) defaults to undefined|
| **q** | [**string**] | name filter | (optional) defaults to undefined|


### Return type

**Array<Package>**

### Authorization

[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | PackageList |  -  |
|**404** | APINotFound is a not found error response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **unlinkPackage**
> unlinkPackage()


### Example

```typescript
import {
    PackageApi,
    Configuration
} from 'berg';

const configuration = new Configuration();
const apiInstance = new PackageApi(configuration);

let owner: string; //owner of the package (default to undefined)
let type: string; //type of the package (default to undefined)
let name: string; //name of the package (default to undefined)

const { status, data } = await apiInstance.unlinkPackage(
    owner,
    type,
    name
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **owner** | [**string**] | owner of the package | defaults to undefined|
| **type** | [**string**] | type of the package | defaults to undefined|
| **name** | [**string**] | name of the package | defaults to undefined|


### Return type

void (empty response body)

### Authorization

[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json, text/html


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**201** | APIEmpty is an empty response |  -  |
|**404** | APINotFound is a not found error response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

