# Sylius\CountryApi

Resource &#39;Country&#39; operations.

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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**syliusApiAdminCountryGet()**](CountryApi.md#syliusApiAdminCountryGet) | **GET** /api/v2/admin/countries/{code} | Retrieves a Country resource. |
| [**syliusApiAdminCountryGetCollection()**](CountryApi.md#syliusApiAdminCountryGetCollection) | **GET** /api/v2/admin/countries | Retrieves the collection of Country resources. |
| [**syliusApiAdminCountryPost()**](CountryApi.md#syliusApiAdminCountryPost) | **POST** /api/v2/admin/countries | Creates a Country resource. |
| [**syliusApiAdminCountryPut()**](CountryApi.md#syliusApiAdminCountryPut) | **PUT** /api/v2/admin/countries/{code} | Replaces the Country resource. |
| [**syliusApiShopCountryGet()**](CountryApi.md#syliusApiShopCountryGet) | **GET** /api/v2/shop/countries/{code} | Retrieves a Country resource. |
| [**syliusApiShopCountryGetCollection()**](CountryApi.md#syliusApiShopCountryGetCollection) | **GET** /api/v2/shop/countries | Retrieves the collection of Country resources. |


## `syliusApiAdminCountryGet()`

```php
syliusApiAdminCountryGet($code, $accept_language): \Sylius\Model\CountryJsonldSyliusAdminCountryShow
```

Retrieves a Country resource.

Retrieves a Country 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\CountryApi(
    // 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 | Country 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->syliusApiAdminCountryGet($code, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CountryApi->syliusApiAdminCountryGet: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

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

## `syliusApiAdminCountryGetCollection()`

```php
syliusApiAdminCountryGetCollection($page, $items_per_page, $accept_language): \Sylius\Model\SyliusApiAdminCountryGetCollection200Response
```

Retrieves the collection of Country resources.

Retrieves the collection of Country 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\CountryApi(
    // 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
$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->syliusApiAdminCountryGetCollection($page, $items_per_page, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CountryApi->syliusApiAdminCountryGetCollection: ', $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] |
| **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\SyliusApiAdminCountryGetCollection200Response**](../Model/SyliusApiAdminCountryGetCollection200Response.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)

## `syliusApiAdminCountryPost()`

```php
syliusApiAdminCountryPost($country_sylius_admin_country_create, $accept_language): \Sylius\Model\CountryJsonldSyliusAdminCountryShow
```

Creates a Country resource.

Creates a Country 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\CountryApi(
    // 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
);
$country_sylius_admin_country_create = new \Sylius\Model\CountrySyliusAdminCountryCreate(); // \Sylius\Model\CountrySyliusAdminCountryCreate | The new Country 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->syliusApiAdminCountryPost($country_sylius_admin_country_create, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CountryApi->syliusApiAdminCountryPost: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **country_sylius_admin_country_create** | [**\Sylius\Model\CountrySyliusAdminCountryCreate**](../Model/CountrySyliusAdminCountryCreate.md)| The new Country 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\CountryJsonldSyliusAdminCountryShow**](../Model/CountryJsonldSyliusAdminCountryShow.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)

## `syliusApiAdminCountryPut()`

```php
syliusApiAdminCountryPut($code, $country_sylius_admin_country_update, $accept_language): \Sylius\Model\CountryJsonldSyliusAdminCountryShow
```

Replaces the Country resource.

Replaces the Country 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\CountryApi(
    // 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 | Country identifier
$country_sylius_admin_country_update = new \Sylius\Model\CountrySyliusAdminCountryUpdate(); // \Sylius\Model\CountrySyliusAdminCountryUpdate | The updated Country 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->syliusApiAdminCountryPut($code, $country_sylius_admin_country_update, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CountryApi->syliusApiAdminCountryPut: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **code** | **string**| Country identifier | |
| **country_sylius_admin_country_update** | [**\Sylius\Model\CountrySyliusAdminCountryUpdate**](../Model/CountrySyliusAdminCountryUpdate.md)| The updated Country 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\CountryJsonldSyliusAdminCountryShow**](../Model/CountryJsonldSyliusAdminCountryShow.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)

## `syliusApiShopCountryGet()`

```php
syliusApiShopCountryGet($code, $accept_language): \Sylius\Model\CountryJsonldSyliusShopCountryShow
```

Retrieves a Country resource.

Retrieves a Country 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\CountryApi(
    // 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 | Country 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->syliusApiShopCountryGet($code, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CountryApi->syliusApiShopCountryGet: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

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

## `syliusApiShopCountryGetCollection()`

```php
syliusApiShopCountryGetCollection($page, $items_per_page, $accept_language): \Sylius\Model\SyliusApiShopCountryGetCollection200Response
```

Retrieves the collection of Country resources.

Retrieves the collection of Country 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\CountryApi(
    // 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
$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->syliusApiShopCountryGetCollection($page, $items_per_page, $accept_language);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CountryApi->syliusApiShopCountryGetCollection: ', $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] |
| **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\SyliusApiShopCountryGetCollection200Response**](../Model/SyliusApiShopCountryGetCollection200Response.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)
