// Path: src/main/java/com/edwise/completespring/assemblers/FooResource.java
// @Getter
// @Setter
// @Accessors(chain = true)
// public class FooResource extends ResourceSupport {
//     private Foo foo;
// }
// 
// Path: src/main/java/com/edwise/completespring/assemblers/FooResourceAssembler.java
// @Component
// public class FooResourceAssembler extends ResourceAssemblerSupport<Foo, FooResource> {
// 
//     public FooResourceAssembler() {
//         super(FooController.class, FooResource.class);
//     }
// 
//     @Override
//     protected FooResource instantiateResource(Foo foo) {
//         FooResource fooResource = super.instantiateResource(foo);
//         fooResource.setFoo(foo);
// 
//         return fooResource;
//     }
// 
//     public FooResource toResource(Foo foo) {
//         return this.createResourceWithId(foo.getId(), foo);
//     }
// }
// 
// Path: src/main/java/com/edwise/completespring/entities/Foo.java
// @ApiModel(value = "Foo entity", description = "Complete info of a entity foo")
// @Data
// @Accessors(chain = true)
// @EqualsAndHashCode(exclude = {"id"}, doNotUseGetters = true)
// @ToString(doNotUseGetters = true)
// public class Foo {
// 
//     @ApiModelProperty(value = "Sample Id Attribute", required = true)
//     private Long id;
// 
//     @ApiModelProperty(value = "Sample Text Attribute", required = true)
//     @NotNull
//     private String sampleTextAttribute;
// 
//     @ApiModelProperty(value = "Sample Local Date Attribute", required = true, dataType = "LocalDate")
//     @NotNull
//     private LocalDate sampleLocalDateAttribute;
// 
//     public Foo copyFrom(Foo other) {
//         this.sampleTextAttribute = other.sampleTextAttribute;
//         this.sampleLocalDateAttribute = other.sampleLocalDateAttribute;
// 
//         return this;
//     }
// }
// 
// Path: src/main/java/com/edwise/completespring/exceptions/InvalidRequestException.java
// public class InvalidRequestException extends RuntimeException {
// 
//     @Getter
//     private final ErrorInfo errors;
// 
//     public InvalidRequestException(BindingResult bindingResultErrors) {
//         super(bindingResultErrors.toString());
//         this.errors = ErrorInfo.generateErrorInfoFromBindingResult(bindingResultErrors);
//     }
// 
// }


import com.edwise.completespring.assemblers.FooResource;
import com.edwise.completespring.assemblers.FooResourceAssembler;
import com.edwise.completespring.entities.Foo;
import com.edwise.completespring.exceptions.InvalidRequestException;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.Link;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.net.URI;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;
package com.edwise.completespring.controllers;



@RestController
@RequestMapping(value = "/api/foos/")
@Api(value = "foos", description = "Foo API", produces = "application/json")
@Slf4j
public class FooController {
    private static final int RESPONSE_CODE_OK = 200;
    private static final int RESPONSE_CODE_CREATED = 201;
    private static final int RESPONSE_CODE_NO_RESPONSE = 204;
    private static final String TEST_ATTRIBUTE_1 = "AttText1";

    @Autowired
    private FooResourceAssembler fooResourceAssembler;

    @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "Get Foos", notes = "Returns all foos")
    @ApiResponses({
// Path: src/main/java/com/edwise/completespring/assemblers/FooResource.java
// @Getter
// @Setter
// @Accessors(chain = true)
// public class FooResource extends ResourceSupport {
//     private Foo foo;
// }
// 
// Path: src/main/java/com/edwise/completespring/assemblers/FooResourceAssembler.java
// @Component
// public class FooResourceAssembler extends ResourceAssemblerSupport<Foo, FooResource> {
// 
//     public FooResourceAssembler() {
//         super(FooController.class, FooResource.class);
//     }
// 
//     @Override
//     protected FooResource instantiateResource(Foo foo) {
//         FooResource fooResource = super.instantiateResource(foo);
//         fooResource.setFoo(foo);
// 
//         return fooResource;
//     }
// 
//     public FooResource toResource(Foo foo) {
//         return this.createResourceWithId(foo.getId(), foo);
//     }
// }
// 
// Path: src/main/java/com/edwise/completespring/entities/Foo.java
// @ApiModel(value = "Foo entity", description = "Complete info of a entity foo")
// @Data
// @Accessors(chain = true)
// @EqualsAndHashCode(exclude = {"id"}, doNotUseGetters = true)
// @ToString(doNotUseGetters = true)
// public class Foo {
// 
//     @ApiModelProperty(value = "Sample Id Attribute", required = true)
//     private Long id;
// 
//     @ApiModelProperty(value = "Sample Text Attribute", required = true)
//     @NotNull
//     private String sampleTextAttribute;
// 
//     @ApiModelProperty(value = "Sample Local Date Attribute", required = true, dataType = "LocalDate")
//     @NotNull
//     private LocalDate sampleLocalDateAttribute;
// 
//     public Foo copyFrom(Foo other) {
//         this.sampleTextAttribute = other.sampleTextAttribute;
//         this.sampleLocalDateAttribute = other.sampleLocalDateAttribute;
// 
//         return this;
//     }
// }
// 
// Path: src/main/java/com/edwise/completespring/exceptions/InvalidRequestException.java
// public class InvalidRequestException extends RuntimeException {
// 
//     @Getter
//     private final ErrorInfo errors;
// 
//     public InvalidRequestException(BindingResult bindingResultErrors) {
//         super(bindingResultErrors.toString());
//         this.errors = ErrorInfo.generateErrorInfoFromBindingResult(bindingResultErrors);
//     }
// 
// }


// Path: src/main/java/com/edwise/completespring/controllers/FooController.java
import com.edwise.completespring.assemblers.FooResource;
import com.edwise.completespring.assemblers.FooResourceAssembler;
import com.edwise.completespring.entities.Foo;
import com.edwise.completespring.exceptions.InvalidRequestException;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.Link;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.net.URI;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;

package com.edwise.completespring.controllers;



@RestController
@RequestMapping(value = "/api/foos/")
@Api(value = "foos", description = "Foo API", produces = "application/json")
@Slf4j
public class FooController {
    private static final int RESPONSE_CODE_OK = 200;
    private static final int RESPONSE_CODE_CREATED = 201;
    private static final int RESPONSE_CODE_NO_RESPONSE = 204;
    private static final String TEST_ATTRIBUTE_1 = "AttText1";

    @Autowired
    private FooResourceAssembler fooResourceAssembler;

    @RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "Get Foos", notes = "Returns all foos")
    @ApiResponses({
            @ApiResponse(code = RESPONSE_CODE_OK, response = FooResource.class, message = "Exits one foo at least")