/**
 * This model is for creating new REST platform code patterns.
 * Develop the first 8 methods for either client or server REST services.
 * Templates will be created for that language platform. After initial Templates
 * are created these can be modified for maintenance and passed in as part of the compile.
 *
 * Separate client, common, server files / directories.
 * Separate server business logic implementations with simple mocks. These will be create once tempates.
 * Separate client connect code for create once modification
 * You can use third party open source library's
 * You can even have your own library's, that will ship with source.
 * Add Comments.
 *
 * Add links to your You-Tube and WebSite in the code.
 */
Application Develop = com.companyname {
    Endpoint IDevelop = 510 {
        Exception DevelopException {};

        Bean Baz {
            int baz;
        };
        Bean Stuff {
            Long foo;
            String bar;
            Baz bazBean;
            Date dt;
            Timestamp ts;
        };

        Bean TestBean {
            String[] member1;
            Integer member2;
        };
        Enumeration MyMessageType { Empty=1, Full=2 };
        Exception BeanException {};

        Dictionary<Baz> BazDictionary;

        Server Stateless { // Stateless, Session, Singleton
            /**
             * Dictionary
             */
            @Path("get-baz-dictionary.json")
            @Produces(JSON)
            @GET BazDictionary getBazDictionary() throws DevelopException;

            /**
             * Path/Query/Header
             */
            @Path("setPathParam.json/{foo}")
            @Produces(JSON)
            @POST Boolean setPathParam(@PathParam("foo") String foo ) throws DevelopException;

            @Path("setQueryParam.json")
            @Produces(JSON)
            @POST Boolean setQueryParam(@QueryParam("foo") @DefaultValue("bar") String foo ) throws DevelopException;

            /**
             * List
             */
            @Path("setList.json")
            @Produces(JSON)
            @Consumes(JSON)
            @POST List<int> setList( @In List<String> foolist ) throws DevelopException;

            @Path("setBeanList.json")
            @Produces(JSON)
            @Consumes(JSON)
            @POST List<Stuff> setBeanList( @In List<Stuff> beanlist ) throws DevelopException;

            @Path("setBeanOut.json")
            @Produces(JSON)
            @POST Stuff setBeanOut( ) throws DevelopException;

            @Path("beanMethod")
                  @Produces(JSON)
                  @Consumes(JSON)
                  @POST  Boolean beanMethod(@In TestBean arg, @In TestBean[] argArray, @In MyMessageType option) raises BeanException;

            @Path("beanInReturn")
                  @Produces(JSON)
                  @Consumes(JSON)
                  @POST  TestBean beanInReturn(@In TestBean arg) raises BeanException;

            /**
             * Don't do these
             */
            @Path("setInOut.json")
            @Produces(JSON)
            @Consumes(JSON)
            @POST String setInOut(@In String foo) throws DevelopException;

            @Path("setNothing.json")
            @POST void setNothing();

            @Path("setBeanListOut.json")
            @Produces(JSON)
            @POST List<Stuff> setBeanListOut(  ) throws DevelopException;

            @Path("setHeaderParam.json")
            @Produces(JSON)
            @POST Boolean setHeaderParam(@HeaderParam("foo") @DefaultValue("bar") String foo ) throws DevelopException;
       };
    };
};
