{"swagger":"2.0","info":{"description":"API para crear colecciones de peliculas","version":"1.0.0","title":"A2M-Movies","contact":{"email":"aleruizjurado@gmail.com"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"schemes":["https"],"host":"a2m-movies.appspot.com","basePath":"/api","paths":{"/collections":{"get":{"tags":["Collections"],"summary":"get all Collections","operationId":"getCollections","description":"With this operation you can get all the Collections\n","produces":["application/json"],"parameters":[{"name":"searchQuery","in":"query","description":"to filter collections by name","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"$ref":"#/definitions/Collections"}}},"400":{"description":"Bad Request"}}},"post":{"tags":["Collections"],"summary":"create a Collection","operationId":"createCollection","description":"With this operation you can create a new collection of movies\n","produces":["application/json"],"parameters":[{"name":"name","in":"body","description":"name of the new collection","required":true,"schema":{"$ref":"#/definitions/Collections"}}],"responses":{"201":{"description":"Create successfully","schema":{"$ref":"#/definitions/Collections"}},"400":{"description":"Bad Request"}}},"put":{"tags":["Collections"],"summary":"update a Collection","operationId":"updateCollection","description":"With this operation you can update a collection\n","produces":["application/json"],"parameters":[{"name":"name","in":"body","description":"new name of the collection","required":true,"schema":{"$ref":"#/definitions/Collections"}}],"responses":{"204":{"description":"Updated successfully"},"400":{"description":"Bad Request"},"404":{"description":"Collection not found"}}}},"/collections/{id}":{"delete":{"tags":["Collections"],"summary":"delete a Collection","operationId":"deleteCollection","description":"With this operation you can delete a collection of movies\n","produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"id of the collection","required":true,"type":"string"}],"responses":{"204":{"description":"Deleted successfully"},"404":{"description":"Collection not found"}}},"get":{"tags":["Collections"],"summary":"get a Collection","operationId":"getCollection","description":"With this operation you can get a collection of movies\n","produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"id of the collection","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Collections"}},"404":{"description":"Collection not found"}}}},"/collections/{id}/{movieId}":{"post":{"tags":["Collections"],"summary":"add a movie to your collection","operationId":"addMovie","description":"With this operation you can add a movie to your collection\n","produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"id of the collection","required":true,"type":"string"},{"name":"movieId","in":"path","description":"id of the movie","required":true,"type":"string"}],"responses":{"200":{"description":"Added successfully","schema":{"$ref":"#/definitions/Collections"}},"400":{"description":"Bad Request"},"404":{"description":"Collection or Movie not found"}}},"delete":{"tags":["Collections"],"summary":"quit a movie in your collection","operationId":"quitMovie","description":"With this operation you can delete a collection of movies\n","produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"id of the collection","required":true,"type":"string"},{"name":"movieId","in":"path","description":"id of the movie","required":true,"type":"string"}],"responses":{"204":{"description":"Deleted successfully"},"404":{"description":"Collection or Movie not found"}}}},"/movies":{"get":{"tags":["Movies"],"summary":"get all Movies","operationId":"getMovies","description":"With this operation you can get all the Movies\n","produces":["application/json"],"parameters":[{"name":"searchQuery","in":"query","description":"to filter movies by name","required":false,"type":"string"},{"name":"order","in":"query","description":"to order movies","required":false,"type":"string","enum":["year","-year","genre","-genre"]}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"$ref":"#/definitions/Movies"}}},"400":{"description":"Bad Request"}}},"post":{"tags":["Movies"],"summary":"create a Movie","operationId":"createMovie","description":"With this operation you can create a new movie\n","produces":["application/json"],"parameters":[{"name":"movie","in":"body","description":"the new movie","required":true,"schema":{"$ref":"#/definitions/Movies"}}],"responses":{"201":{"description":"Created successfully","schema":{"$ref":"#/definitions/Movies"}},"400":{"description":"Bad Request"}}},"put":{"tags":["Movies"],"summary":"update a Movie","operationId":"updateMovie","description":"With this operation you can update a movie\n","produces":["application/json"],"parameters":[{"name":"movie","in":"body","description":"updated movie","required":true,"schema":{"$ref":"#/definitions/Movies"}}],"responses":{"204":{"description":"Updated successfully"},"400":{"description":"Bad Request"},"404":{"description":"Movie not found"}}}},"/movies/{id}":{"delete":{"tags":["Movies"],"summary":"delete a Movies","operationId":"deleteMovie","description":"With this operation you can delete a movie\n","produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"id of the movie","required":true,"type":"string"}],"responses":{"204":{"description":"Deleted successfully"},"404":{"description":"Movie not found"}}},"get":{"tags":["Movies"],"summary":"get a Movies","operationId":"getMovie","description":"With this operation you can get a movie\n","produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"id of the movie","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Movies"}},"404":{"description":"Movie not found"}}}}},"definitions":{"Collections":{"type":"object","required":["name","movies"],"properties":{"id":{"type":"string","example":"c1"},"name":{"type":"string","example":"Mis pelis"},"movies":{"type":"array","items":{"$ref":"#/definitions/Movies"}}}},"Movies":{"required":["name"],"properties":{"id":{"type":"string","example":"m2"},"name":{"type":"string","example":"Batman Begins"},"year":{"type":"integer","example":2005},"producer":{"type":"string","example":"Warner Bros."},"genre":{"type":"string","example":"Superhéroes"},"director":{"type":"string","example":"Christopher Nolan"},"length":{"type":"integer","example":140}}}}}