# Sylius\ProductAttributeApi

Resource &#39;ProductAttribute&#39; operations.

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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**syliusApiAdminProductAttributeDelete()**](ProductAttributeApi.md#syliusApiAdminProductAttributeDelete) | **DELETE** /api/v2/admin/product-attributes/{code} | Removes the ProductAttribute resource. |
| [**syliusApiAdminProductAttributeGet()**](ProductAttributeApi.md#syliusApiAdminProductAttributeGet) | **GET** /api/v2/admin/product-attributes/{code} | Retrieves a ProductAttribute resource. |
| [**syliusApiAdminProductAttributeGetCollection()**](ProductAttributeApi.md#syliusApiAdminProductAttributeGetCollection) | **GET** /api/v2/admin/product-attributes | Retrieves the collection of ProductAttribute resources. |
| [**syliusApiAdminProductAttributePost()**](ProductAttributeApi.md#syliusApiAdminProductAttributePost) | **POST** /api/v2/admin/product-attributes | Creates a ProductAttribute resource. |
| [**syliusApiAdminProductAttributePut()**](ProductAttributeApi.md#syliusApiAdminProductAttributePut) | **PUT** /api/v2/admin/product-attributes/{code} | Replaces the ProductAttribute resource. |
| [**syliusApiShopProductAttributeGet()**](ProductAttributeApi.md#syliusApiShopProductAttributeGet) | **GET** /api/v2/shop/product-attributes/{code} | Retrieves a ProductAttribute resource. |


## `syliusApiAdminProductAttributeDelete()`

```php
syliusApiAdminProductAttributeDelete($code, $accept_language)
```

Removes the ProductAttribute resource.

Removes the ProductAttribute 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\ProductAttributeApi(
    // 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
);
$code = 'code_example'; // string | ProductAttribute 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->syliusApiAdminProductAttributeDelete($code, $accept_language);
} catch (Exception $e) {
    echo 'Exception when calling ProductAttributeApi->syliusApiAdminProductAttributeDelete: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| ProductAttribute 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)

## `syliusApiAdminProductAttributeGet()`

```php
syliusApiAdminProductAttributeGet($code, $accept_language): \Sylius\Model\ProductAttributeJsonldSyliusAdminProductAttributeShow
```

Retrieves a ProductAttribute resource.

Retrieves a ProductAttribute 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\ProductAttributeApi(
    // 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
);
$code = 'code_example'; // string | ProductAttribute 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->syliusApiAdminProductAttributeGet($code, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductAttributeApi->syliusApiAdminProductAttributeGet: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| ProductAttribute 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\ProductAttributeJsonldSyliusAdminProductAttributeShow**](../Model/ProductAttributeJsonldSyliusAdminProductAttributeShow.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)

## `syliusApiAdminProductAttributeGetCollection()`

```php
syliusApiAdminProductAttributeGetCollection($page, $items_per_page, $translatable, $order_position, $code, $type, $type2, $translations_name, $accept_language): \Sylius\Model\SyliusApiAdminProductAttributeGetCollection200Response
```

Retrieves the collection of ProductAttribute resources.

Retrieves the collection of ProductAttribute 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\ProductAttributeApi(
    // 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
$translatable = True; // bool | 
$order_position = ''; // string | 
$code = 'code_example'; // string | 
$type = 'type_example'; // string | 
$type2 = array('type_example'); // string[] | 
$translations_name = 'translations_name_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->syliusApiAdminProductAttributeGetCollection($page, $items_per_page, $translatable, $order_position, $code, $type, $type2, $translations_name, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductAttributeApi->syliusApiAdminProductAttributeGetCollection: ', $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] |
| **translatable** | **bool**|  | [optional] |
| **order_position** | **string**|  | [optional] [default to &#39;&#39;] |
| **code** | **string**|  | [optional] |
| **type** | **string**|  | [optional] |
| **type2** | [**string[]**](../Model/string.md)|  | [optional] |
| **translations_name** | **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\SyliusApiAdminProductAttributeGetCollection200Response**](../Model/SyliusApiAdminProductAttributeGetCollection200Response.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)

## `syliusApiAdminProductAttributePost()`

```php
syliusApiAdminProductAttributePost($product_attribute_sylius_admin_product_attribute_create, $accept_language): \Sylius\Model\ProductAttributeJsonldSyliusAdminProductAttributeShow
```

Creates a ProductAttribute resource.

Creates a ProductAttribute 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\ProductAttributeApi(
    // 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_attribute_sylius_admin_product_attribute_create = new \Sylius\Model\ProductAttributeSyliusAdminProductAttributeCreate(); // \Sylius\Model\ProductAttributeSyliusAdminProductAttributeCreate | The new ProductAttribute 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->syliusApiAdminProductAttributePost($product_attribute_sylius_admin_product_attribute_create, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductAttributeApi->syliusApiAdminProductAttributePost: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **product_attribute_sylius_admin_product_attribute_create** | [**\Sylius\Model\ProductAttributeSyliusAdminProductAttributeCreate**](../Model/ProductAttributeSyliusAdminProductAttributeCreate.md)| The new ProductAttribute 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\ProductAttributeJsonldSyliusAdminProductAttributeShow**](../Model/ProductAttributeJsonldSyliusAdminProductAttributeShow.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)

## `syliusApiAdminProductAttributePut()`

```php
syliusApiAdminProductAttributePut($code, $product_attribute_sylius_admin_product_attribute_update, $accept_language): \Sylius\Model\ProductAttributeJsonldSyliusAdminProductAttributeShow
```

Replaces the ProductAttribute resource.

Replaces the ProductAttribute 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\ProductAttributeApi(
    // 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
);
$code = 'code_example'; // string | ProductAttribute identifier
$product_attribute_sylius_admin_product_attribute_update = new \Sylius\Model\ProductAttributeSyliusAdminProductAttributeUpdate(); // \Sylius\Model\ProductAttributeSyliusAdminProductAttributeUpdate | The updated ProductAttribute 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->syliusApiAdminProductAttributePut($code, $product_attribute_sylius_admin_product_attribute_update, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductAttributeApi->syliusApiAdminProductAttributePut: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| ProductAttribute identifier | |
| **product_attribute_sylius_admin_product_attribute_update** | [**\Sylius\Model\ProductAttributeSyliusAdminProductAttributeUpdate**](../Model/ProductAttributeSyliusAdminProductAttributeUpdate.md)| The updated ProductAttribute 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\ProductAttributeJsonldSyliusAdminProductAttributeShow**](../Model/ProductAttributeJsonldSyliusAdminProductAttributeShow.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)

## `syliusApiShopProductAttributeGet()`

```php
syliusApiShopProductAttributeGet($code, $accept_language): \Sylius\Model\ProductAttributeJsonldSyliusShopProductAttributeShow
```

Retrieves a ProductAttribute resource.

Retrieves a ProductAttribute 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\ProductAttributeApi(
    // 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
);
$code = 'code_example'; // string | ProductAttribute 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->syliusApiShopProductAttributeGet($code, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductAttributeApi->syliusApiShopProductAttributeGet: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| ProductAttribute 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\ProductAttributeJsonldSyliusShopProductAttributeShow**](../Model/ProductAttributeJsonldSyliusShopProductAttributeShow.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)
