<?xml version="1.0" encoding="UTF-8" ?>
<!-- api/config/api_platform/resources.xml -->
<resources xmlns= "https://api-platform.com/schema/metadata/resources-3.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
https://api-platform.com/schema/metadata/resources-3.0.xsd">
<resource class= "App\Entity\User" >
<operations >
<operation class= "ApiPlatform\Metadata\Get" />
<operation class= "ApiPlatform\Metadata\Get" controller= "App\Controller\GetUserByName" uriTemplate= "users/authName/{authName}" description= "Receives a user by its authentication name" >
<uriVariables > <uriVariable parameterName= "authName" > </uriVariable> </uriVariables>
</operation>
<operation class= "ApiPlatform\Metadata\Patch" />
</operations>
</resource>
<resource class= "App\Entity\Country" >
<operations >
<operation class= "ApiPlatform\Metadata\GetCollection" />
<operation class= "ApiPlatform\Metadata\Get" />
</operations>
</resource>
<resource class= "App\Entity\City" uriTemplate= "/country/{countryId}/capital" >
<uriVariables >
<uriVariable parameterName= "countryId" fromClass= "App\Entity\Country" toProperty= "capital" > </uriVariable>
</uriVariables>
<operations >
<operation class= "ApiPlatform\Metadata\Get" />
</operations>
</resource>
<resource class= "App\Entity\City" uriTemplate= "/prefecture/{prefectureId}/capital" >
<uriVariables >
<uriVariable parameterName= "prefectureId" fromClass= "App\Entity\Prefecture" toProperty= "capital" > </uriVariable>
</uriVariables>
<operations >
<operation class= "ApiPlatform\Metadata\Get" />
</operations>
</resource>
<resource class= "App\Entity\City" >
<operations >
<operation class= "ApiPlatform\Metadata\Get" />
</operations>
</resource>
<resource class= "App\Entity\Village" uriTemplate= "/prefecture/{prefectureId}/villages" >
<uriVariables >
<uriVariable parameterName= "prefectureId" fromClass= "App\Entity\Prefecture" toProperty= "villages" > </uriVariable>
</uriVariables>
<operations >
<operation class= "ApiPlatform\Metadata\GetCollection" />
</operations>
</resource>
<resource class= "App\Entity\Village" >
<operations >
<operation class= "ApiPlatform\Metadata\Get" />
</operations>
</resource>
<resource class= "App\Entity\Prefecture" uriTemplate= "/country/{countryId}/prefectures" >
<uriVariables >
<uriVariable parameterName= "countryId" fromClass= "App\Entity\Country" toProperty= "prefectures" > </uriVariable>
</uriVariables>
<operations >
<operation class= "ApiPlatform\Metadata\GetCollection" />
</operations>
</resource>
<resource class= "App\Entity\Prefecture" >
<operations >
<operation class= "ApiPlatform\Metadata\Get" />
</operations>
</resource>
<resource class= "App\Entity\Dojo" >
<operations >
<operation class= "ApiPlatform\Metadata\Get" />
<operation class= "ApiPlatform\Metadata\Get" uriTemplate= "dojo" controller= "App\Controller\GetUserDojo" />
<operation class= "ApiPlatform\Metadata\Post" processor= "App\State\DojoPostProcessor" />
<operation class= "ApiPlatform\Metadata\Patch" />
</operations>
</resource>
<resource class= "App\Entity\Dojo" uriTemplate= "/village/{villageId}/dojos" >
<uriVariables >
<uriVariable parameterName= "villageId" fromClass= "App\Entity\Village" toProperty= "dojos" > </uriVariable>
</uriVariables>
<operations >
<operation class= "ApiPlatform\Metadata\Get" />
</operations>
</resource>
<resource class= "App\Entity\Dungeon" >
<operations >
<operation class= "ApiPlatform\Metadata\Get" uriTemplate= "dungeon/{id}" />
</operations>
</resource>
<resource class= "App\Entity\Dungeon" uriTemplate= "/city/{cityId}/dungeon" >
<uriVariables >
<uriVariable parameterName= "cityId" fromClass= "App\Entity\City" toProperty= "dungeon" > </uriVariable>
</uriVariables>
<operations >
<operation class= "ApiPlatform\Metadata\Get" />
</operations>
</resource>
<resource class= "App\Entity\Character" >
<normalizationContext > <values > <value name= "groups" > <values > <value > public</value> </values> </value> </values> </normalizationContext>
<operations >
<operation class= "ApiPlatform\Metadata\Get" />
<operation class= "ApiPlatform\Metadata\GetCollection" controller= "App\Controller\GetDojoCharacters" uriTemplate= "dojos/{dojoId}/characters" description= "Receives the characters from a dojo." >
<uriVariables > <uriVariable parameterName= "dojoId" /> </uriVariables>
</operation>
<operation class= "ApiPlatform\Metadata\GetCollection" controller= "App\Controller\GetOwnDojoCharacters" uriTemplate= "dojo/characters" description= "Receives the characters from the users dojo." >
<normalizationContext > <values > <value name= "groups" > <values > <value > public</value> <value > detail</value> </values> </value> </values> </normalizationContext>
</operation>
</operations>
</resource>
<resource class= "App\Entity\Character" >
<operations >
<operation class= "ApiPlatform\Metadata\Post" />
<operation class= "ApiPlatform\Metadata\Patch" />
</operations>
</resource>
<resource class= "App\Entity\Technique" >
<operations >
<operation class= "ApiPlatform\Metadata\Get" />
<operation class= "ApiPlatform\Metadata\GetCollection" />
<operation class= "ApiPlatform\Metadata\Post" security= "is_granted('ROLE_ADMIN')" >
</operation>
</operations>
</resource>
<resource class= "App\Entity\Tournament" >
<operations >
<operation class= "ApiPlatform\Metadata\Get" />
<operation class= "ApiPlatform\Metadata\GetCollection" />
</operations>
</resource>
<resource class= "App\Entity\TournamentRegistration" >
<operations >
<operation class= "ApiPlatform\Metadata\Post" processor= "App\State\TournamentRegistrationStateProcessor" />
</operations>
</resource>
<resource class= "App\Entity\Fight" >
<operations >
<operation class= "ApiPlatform\Metadata\Get" />
<operation class= "ApiPlatform\Metadata\GetCollection" controller= "App\Controller\GetTournamentFights" uriTemplate= "tournaments/{tournamentId}/fights" description= "Receives the fights from a tournament." >
<uriVariables > <uriVariable parameterName= "tournamentId" fromClass= "App\Entity\Tournament" > </uriVariable> </uriVariables>
</operation>
<operation class= "ApiPlatform\Metadata\GetCollection" controller= "App\Controller\GetTournamentFights" uriTemplate= "tournaments/{tournamentId}/characters/{characterId}/fights" description= "Receives the fights from a tournament for a given character." >
<uriVariables >
<uriVariable parameterName= "tournamentId" fromClass= "App\Entity\Tournament" > </uriVariable>
<uriVariable parameterName= "characterId" fromClass= "App\Entity\Character" > </uriVariable>
</uriVariables>
</operation>
</operations>
</resource>
</resources>