<?php
return [
    'service_manager' => [
        'factories' => [
            \gnuboat_mapservice\V1\Rest\Upload\UploadResource::class => \gnuboat_mapservice\V1\Rest\Upload\UploadResourceFactory::class,
            \gnuboat_mapservice\V1\Rest\Waters\WatersResource::class => \gnuboat_mapservice\V1\Rest\Waters\WatersResourceFactory::class,
        ],
    ],
    'router' => [
        'routes' => [
            'gnuboat_mapservice.rest.upload' => [
                'type' => 'Segment',
                'options' => [
                    'route' => '/upload[/:upload_id]',
                    'defaults' => [
                        'controller' => 'gnuboat_mapservice\\V1\\Rest\\Upload\\Controller',
                    ],
                ],
            ],
            'gnuboat_mapservice.rest.waters' => [
                'type' => 'Segment',
                'options' => [
                    'route' => '/waters[/:waters_id]',
                    'defaults' => [
                        'controller' => 'gnuboat_mapservice\\V1\\Rest\\Waters\\Controller',
                    ],
                ],
            ],
        ],
    ],
    'zf-versioning' => [
        'uri' => [
            0 => 'gnuboat_mapservice.rest.upload',
            1 => 'gnuboat_mapservice.rest.waters',
        ],
    ],
    'zf-rest' => [
        'gnuboat_mapservice\\V1\\Rest\\Upload\\Controller' => [
            'listener' => \gnuboat_mapservice\V1\Rest\Upload\UploadResource::class,
            'route_name' => 'gnuboat_mapservice.rest.upload',
            'route_identifier_name' => 'upload_id',
            'collection_name' => 'upload',
            'entity_http_methods' => [
                0 => 'GET',
                1 => 'PATCH',
                2 => 'PUT',
                3 => 'DELETE',
            ],
            'collection_http_methods' => [
                0 => 'GET',
                1 => 'POST',
            ],
            'collection_query_whitelist' => [],
            'page_size' => 25,
            'page_size_param' => null,
            'entity_class' => \gnuboat_mapservice\V1\Rest\Upload\UploadEntity::class,
            'collection_class' => \gnuboat_mapservice\V1\Rest\Upload\UploadCollection::class,
            'service_name' => 'upload',
        ],
        'gnuboat_mapservice\\V1\\Rest\\Waters\\Controller' => [
            'listener' => \gnuboat_mapservice\V1\Rest\Waters\WatersResource::class,
            'route_name' => 'gnuboat_mapservice.rest.waters',
            'route_identifier_name' => 'waters_id',
            'collection_name' => 'waters',
            'entity_http_methods' => [
                0 => 'GET',
                1 => 'PATCH',
                2 => 'PUT',
                3 => 'DELETE',
            ],
            'collection_http_methods' => [
                0 => 'GET',
                1 => 'POST',
            ],
            'collection_query_whitelist' => [
                0 => 'label',
            ],
            'page_size' => 25,
            'page_size_param' => null,
            'entity_class' => \gnuboat_mapservice\GnuBoat\MapService\Water::class,
            'collection_class' => 'GnuBoat\\MapService\\WaterCollection',
            'service_name' => 'waters',
        ],
    ],
    'zf-content-negotiation' => [
        'controllers' => [
            'gnuboat_mapservice\\V1\\Rest\\Upload\\Controller' => 'HalJson',
            'gnuboat_mapservice\\V1\\Rest\\Waters\\Controller' => 'HalJson',
        ],
        'accept_whitelist' => [
            'gnuboat_mapservice\\V1\\Rest\\Upload\\Controller' => [
                0 => 'application/vnd.gnuboat_mapservice.v1+json',
                1 => 'application/hal+json',
                2 => 'application/json',
            ],
            'gnuboat_mapservice\\V1\\Rest\\Waters\\Controller' => [
                0 => 'application/vnd.gnuboat_mapservice.v1+json',
                1 => 'application/hal+json',
                2 => 'application/json',
            ],
        ],
        'content_type_whitelist' => [
            'gnuboat_mapservice\\V1\\Rest\\Upload\\Controller' => [
                0 => 'application/vnd.gnuboat_mapservice.v1+json',
                1 => 'application/json',
            ],
            'gnuboat_mapservice\\V1\\Rest\\Waters\\Controller' => [
                0 => 'application/vnd.gnuboat_mapservice.v1+json',
                1 => 'application/json',
            ],
        ],
    ],
    'zf-hal' => [
        'metadata_map' => [
            \gnuboat_mapservice\V1\Rest\Upload\UploadEntity::class => [
                'entity_identifier_name' => 'id',
                'route_name' => 'gnuboat_mapservice.rest.upload',
                'route_identifier_name' => 'upload_id',
                'hydrator' => \Zend\Hydrator\ArraySerializable::class,
            ],
            \gnuboat_mapservice\V1\Rest\Upload\UploadCollection::class => [
                'entity_identifier_name' => 'id',
                'route_name' => 'gnuboat_mapservice.rest.upload',
                'route_identifier_name' => 'upload_id',
                'is_collection' => true,
            ],
            'gnuboat_mapservice\\V1\\Rest\\Waters\\WatersEntity' => [
                'entity_identifier_name' => 'id',
                'route_name' => 'gnuboat_mapservice.rest.waters',
                'route_identifier_name' => 'waters_id',
                'hydrator' => \Zend\Hydrator\ArraySerializable::class,
            ],
            'gnuboat_mapservice\\V1\\Rest\\Waters\\WatersCollection' => [
                'entity_identifier_name' => 'id',
                'route_name' => 'gnuboat_mapservice.rest.waters',
                'route_identifier_name' => 'waters_id',
                'is_collection' => true,
            ],
            \gnuboat_mapservice\GnuBoat\MapService\Water::class => [
                'entity_identifier_name' => 'id',
                'route_name' => 'gnuboat_mapservice.rest.waters',
                'route_identifier_name' => 'waters_id',
                'hydrator' => \Zend\Hydrator\Reflection::class,
            ],
            \gnuboat_mapservice\GnuBoat\MapService\WaterCollection::class => [
                'entity_identifier_name' => 'id',
                'route_name' => 'gnuboat_mapservice.rest.waters',
                'route_identifier_name' => 'waters_id',
                'is_collection' => true,
            ],
            'gnuboat_mapservice\\src\\GnuBoat\\MapService\\Water' => [
                'entity_identifier_name' => 'id',
                'route_name' => 'gnuboat_mapservice.rest.waters',
                'route_identifier_name' => 'waters_id',
                'hydrator' => \Zend\Hydrator\Reflection::class,
            ],
            'gnuboat_mapservice\\src\\GnuBoat\\MapService\\WaterCollection' => [
                'entity_identifier_name' => 'id',
                'route_name' => 'gnuboat_mapservice.rest.waters',
                'route_identifier_name' => 'waters_id',
                'is_collection' => true,
            ],
            'GnuBoat\\MapService\\Water' => [
                'entity_identifier_name' => 'id',
                'route_name' => 'gnuboat_mapservice.rest.waters',
                'route_identifier_name' => 'waters_id',
                'hydrator' => \Zend\Hydrator\Reflection::class,
            ],
            'GnuBoat\\MapService\\WaterCollection' => [
                'entity_identifier_name' => 'id',
                'route_name' => 'gnuboat_mapservice.rest.waters',
                'route_identifier_name' => 'waters_id',
                'is_collection' => true,
            ],
        ],
    ],
    'zf-content-validation' => [
        'gnuboat_mapservice\\V1\\Rest\\Waters\\Controller' => [
            'input_filter' => 'gnuboat_mapservice\\V1\\Rest\\Waters\\Validator',
        ],
    ],
    'input_filter_specs' => [
        'gnuboat_mapservice\\V1\\Rest\\Waters\\Validator' => [
            0 => [
                'required' => false,
                'validators' => [
                    0 => [
                        'name' => \Zend\Validator\Digits::class,
                        'options' => [],
                    ],
                ],
                'filters' => [],
                'name' => 'id',
                'description' => 'Unique Identifier',
                'field_type' => 'int',
                'error_message' => 'The identifier of a water must be an integer.',
            ],
            1 => [
                'required' => true,
                'validators' => [],
                'filters' => [
                    0 => [
                        'name' => \Zend\Filter\StringTrim::class,
                        'options' => [],
                    ],
                ],
                'name' => 'label',
                'description' => 'Label of the water',
                'error_message' => 'You must enter a Water name',
            ],
            2 => [
                'required' => false,
                'validators' => [
                    0 => [
                        'name' => \Zend\Validator\Digits::class,
                        'options' => [],
                    ],
                ],
                'filters' => [],
                'name' => 'osm_id',
                'description' => 'OpenStreetMap Id of the object',
                'allow_empty' => true,
            ],
            3 => [
                'required' => false,
                'validators' => [],
                'filters' => [
                    0 => [
                        'name' => \Zend\Filter\StringTrim::class,
                        'options' => [],
                    ],
                ],
                'name' => 'osm_type',
                'description' => 'OpenStreetMap type of the object',
                'field_type' => 'string',
                'allow_empty' => true,
            ],
        ],
    ],
    'zf-mvc-auth' => [
		'authentication' => [
		'map' => [
				'gnuboat_mapservice\\V1'  => 'gnuboat-oauth',
				'ZF\\OAuth2' => 'session',
			],
		],
        'authorization' => [
            'gnuboat_mapservice\\V1\\Rest\\Waters\\Controller' => [
                'collection' => [
                    'GET' => false,
                    'POST' => true,
                    'PUT' => false,
                    'PATCH' => false,
                    'DELETE' => false,
                ],
                'entity' => [
                    'GET' => false,
                    'POST' => false,
                    'PUT' => true,
                    'PATCH' => true,
                    'DELETE' => true,
                ],
            ],
        ],
        'session' => [
			'adapter' => 'Application\\Authentication\\Adapter\\SessionAdapter',
		],
    ],
];
