# Sylius\ProductAssociationApi

Resource &#39;ProductAssociation&#39; operations.

All URIs are relative to http://localhost, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**syliusApiAdminProductAssociationDelete()**](ProductAssociationApi.md#syliusApiAdminProductAssociationDelete) | **DELETE** /api/v2/admin/product-associations/{id} | Removes the ProductAssociation resource. |
| [**syliusApiAdminProductAssociationGet()**](ProductAssociationApi.md#syliusApiAdminProductAssociationGet) | **GET** /api/v2/admin/product-associations/{id} | Retrieves a ProductAssociation resource. |
| [**syliusApiAdminProductAssociationGetCollection()**](ProductAssociationApi.md#syliusApiAdminProductAssociationGetCollection) | **GET** /api/v2/admin/product-associations | Retrieves the collection of ProductAssociation resources. |
| [**syliusApiAdminProductAssociationPost()**](ProductAssociationApi.md#syliusApiAdminProductAssociationPost) | **POST** /api/v2/admin/product-associations | Creates a ProductAssociation resource. |
| [**syliusApiAdminProductAssociationPut()**](ProductAssociationApi.md#syliusApiAdminProductAssociationPut) | **PUT** /api/v2/admin/product-associations/{id} | Replaces the ProductAssociation resource. |
| [**syliusApiShopProductAssociationGet()**](ProductAssociationApi.md#syliusApiShopProductAssociationGet) | **GET** /api/v2/shop/product-associations/{id} | Retrieves a ProductAssociation resource. |


## `syliusApiAdminProductAssociationDelete()`

```php
syliusApiAdminProductAssociationDelete($id, $accept_language)
```

Removes the ProductAssociation resource.

Removes the ProductAssociation resource.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: JWT
$config = Sylius\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Sylius\Api\ProductAssociationApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 'id_example'; // string | ProductAssociation identifier
$accept_language = 'accept_language_example'; // string | Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop.

try {
    $apiInstance->syliusApiAdminProductAssociationDelete($id, $accept_language);
} catch (Exception $e) {
    echo 'Exception when calling ProductAssociationApi->syliusApiAdminProductAssociationDelete: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| ProductAssociation identifier | |
| **accept_language** | **string**| Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop. | [optional] |

### Return type

void (empty response body)

### Authorization

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

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/ld+json`, `application/problem+json`, `application/json`

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

## `syliusApiAdminProductAssociationGet()`

```php
syliusApiAdminProductAssociationGet($id, $accept_language): \Sylius\Model\ProductAssociationJsonldSyliusAdminProductAssociationShow
```

Retrieves a ProductAssociation resource.

Retrieves a ProductAssociation resource.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: JWT
$config = Sylius\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Sylius\Api\ProductAssociationApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 'id_example'; // string | ProductAssociation identifier
$accept_language = 'accept_language_example'; // string | Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop.

try {
    $result = $apiInstance->syliusApiAdminProductAssociationGet($id, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductAssociationApi->syliusApiAdminProductAssociationGet: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| ProductAssociation identifier | |
| **accept_language** | **string**| Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop. | [optional] |

### Return type

[**\Sylius\Model\ProductAssociationJsonldSyliusAdminProductAssociationShow**](../Model/ProductAssociationJsonldSyliusAdminProductAssociationShow.md)

### Authorization

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

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/ld+json`, `application/json`, `application/problem+json`

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

## `syliusApiAdminProductAssociationGetCollection()`

```php
syliusApiAdminProductAssociationGetCollection($page, $items_per_page, $owner_code, $type_code, $accept_language): \Sylius\Model\SyliusApiAdminProductAssociationGetCollection200Response
```

Retrieves the collection of ProductAssociation resources.

Retrieves the collection of ProductAssociation resources.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: JWT
$config = Sylius\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Sylius\Api\ProductAssociationApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$page = 1; // int | The collection page number
$items_per_page = 30; // int | The number of items per page
$owner_code = 'owner_code_example'; // string | 
$type_code = 'type_code_example'; // string | 
$accept_language = 'accept_language_example'; // string | Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop.

try {
    $result = $apiInstance->syliusApiAdminProductAssociationGetCollection($page, $items_per_page, $owner_code, $type_code, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductAssociationApi->syliusApiAdminProductAssociationGetCollection: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **page** | **int**| The collection page number | [optional] [default to 1] |
| **items_per_page** | **int**| The number of items per page | [optional] [default to 30] |
| **owner_code** | **string**|  | [optional] |
| **type_code** | **string**|  | [optional] |
| **accept_language** | **string**| Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop. | [optional] |

### Return type

[**\Sylius\Model\SyliusApiAdminProductAssociationGetCollection200Response**](../Model/SyliusApiAdminProductAssociationGetCollection200Response.md)

### Authorization

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

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/ld+json`, `application/json`

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

## `syliusApiAdminProductAssociationPost()`

```php
syliusApiAdminProductAssociationPost($product_association_sylius_admin_product_association_create, $accept_language): \Sylius\Model\ProductAssociationJsonldSyliusAdminProductAssociationShow
```

Creates a ProductAssociation resource.

Creates a ProductAssociation resource.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: JWT
$config = Sylius\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Sylius\Api\ProductAssociationApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$product_association_sylius_admin_product_association_create = new \Sylius\Model\ProductAssociationSyliusAdminProductAssociationCreate(); // \Sylius\Model\ProductAssociationSyliusAdminProductAssociationCreate | The new ProductAssociation resource
$accept_language = 'accept_language_example'; // string | Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop.

try {
    $result = $apiInstance->syliusApiAdminProductAssociationPost($product_association_sylius_admin_product_association_create, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductAssociationApi->syliusApiAdminProductAssociationPost: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **product_association_sylius_admin_product_association_create** | [**\Sylius\Model\ProductAssociationSyliusAdminProductAssociationCreate**](../Model/ProductAssociationSyliusAdminProductAssociationCreate.md)| The new ProductAssociation resource | |
| **accept_language** | **string**| Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop. | [optional] |

### Return type

[**\Sylius\Model\ProductAssociationJsonldSyliusAdminProductAssociationShow**](../Model/ProductAssociationJsonldSyliusAdminProductAssociationShow.md)

### Authorization

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

### HTTP request headers

- **Content-Type**: `application/ld+json`, `application/json`
- **Accept**: `application/ld+json`, `application/json`, `application/problem+json`

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

## `syliusApiAdminProductAssociationPut()`

```php
syliusApiAdminProductAssociationPut($id, $product_association_sylius_admin_product_association_update, $accept_language): \Sylius\Model\ProductAssociationJsonldSyliusAdminProductAssociationShow
```

Replaces the ProductAssociation resource.

Replaces the ProductAssociation resource.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: JWT
$config = Sylius\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Sylius\Api\ProductAssociationApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 'id_example'; // string | ProductAssociation identifier
$product_association_sylius_admin_product_association_update = new \Sylius\Model\ProductAssociationSyliusAdminProductAssociationUpdate(); // \Sylius\Model\ProductAssociationSyliusAdminProductAssociationUpdate | The updated ProductAssociation resource
$accept_language = 'accept_language_example'; // string | Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop.

try {
    $result = $apiInstance->syliusApiAdminProductAssociationPut($id, $product_association_sylius_admin_product_association_update, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductAssociationApi->syliusApiAdminProductAssociationPut: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| ProductAssociation identifier | |
| **product_association_sylius_admin_product_association_update** | [**\Sylius\Model\ProductAssociationSyliusAdminProductAssociationUpdate**](../Model/ProductAssociationSyliusAdminProductAssociationUpdate.md)| The updated ProductAssociation resource | |
| **accept_language** | **string**| Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop. | [optional] |

### Return type

[**\Sylius\Model\ProductAssociationJsonldSyliusAdminProductAssociationShow**](../Model/ProductAssociationJsonldSyliusAdminProductAssociationShow.md)

### Authorization

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

### HTTP request headers

- **Content-Type**: `application/ld+json`, `application/json`
- **Accept**: `application/ld+json`, `application/json`, `application/problem+json`

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

## `syliusApiShopProductAssociationGet()`

```php
syliusApiShopProductAssociationGet($id, $accept_language): \Sylius\Model\ProductAssociationJsonldSyliusShopProductAssociationShow
```

Retrieves a ProductAssociation resource.

Retrieves a ProductAssociation resource.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: JWT
$config = Sylius\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Sylius\Api\ProductAssociationApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 'id_example'; // string | ProductAssociation identifier
$accept_language = 'accept_language_example'; // string | Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop.

try {
    $result = $apiInstance->syliusApiShopProductAssociationGet($id, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductAssociationApi->syliusApiShopProductAssociationGet: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| ProductAssociation identifier | |
| **accept_language** | **string**| Locales in this enum are all locales defined in the shop and only enabled ones will work in the given channel in the shop. | [optional] |

### Return type

[**\Sylius\Model\ProductAssociationJsonldSyliusShopProductAssociationShow**](../Model/ProductAssociationJsonldSyliusShopProductAssociationShow.md)

### Authorization

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

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/ld+json`, `application/json`, `application/problem+json`

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