// Path: src/main/java/com/frameworkium/core/common/reporting/jira/dto/cycle/CreateCycleSuccessDto.java
// public class CreateCycleSuccessDto extends AbstractDTO<CreateCycleSuccessDto> {
//   public String id;
//   public String responseMessage;
// }
// 
// Path: src/main/java/com/frameworkium/core/common/reporting/jira/dto/cycle/CreateNewCycleDto.java
// @JsonDeserialize(builder = CreateNewCycleDto.Builder.class)
// public class CreateNewCycleDto extends AbstractDTO<CreateNewCycleDto> {
//   @JsonUnwrapped
//   public CycleLightDto cycleLightDto;
//   public String cloneCycleId;
//   public String sprintId;
// 
//   private CreateNewCycleDto(final Builder builder) {
//     cycleLightDto = builder.cycleLightDto;
//     cloneCycleId = builder.cloneCycleId;
//     sprintId = builder.sprintId;
//   }
// 
//   public static Builder newBuilder() {
//     return new Builder();
//   }
// 
//   @JsonPOJOBuilder(withPrefix = "")
//   public static final class Builder {
//     @JsonUnwrapped
//     private CycleLightDto cycleLightDto;
//     private String cloneCycleId;
//     private String sprintId;
// 
//     private Builder() {
//     }
// 
//     public Builder cycleLightDto(final CycleLightDto cycleLightDto) {
//       this.cycleLightDto = cycleLightDto;
//       return this;
//     }
// 
//     public Builder cloneCycleId(final String cloneCycleId) {
//       this.cloneCycleId = cloneCycleId;
//       return this;
//     }
// 
//     public Builder sprintId(final String sprintId) {
//       this.sprintId = sprintId;
//       return this;
//     }
// 
//     public CreateNewCycleDto build() {
//       return new CreateNewCycleDto(this);
//     }
//   }
// }
// 
// Path: src/main/java/com/frameworkium/core/common/reporting/jira/dto/cycle/CycleListDto.java
// public class CycleListDto extends AbstractDTO<CycleListDto> {
//   public Map<String, CycleDto> map = new HashMap<>();
//   public Long recordsCount;
// 
//   @JsonCreator
//   public CycleListDto(@JsonProperty("recordsCount") Long recordsCount) {
//     this.recordsCount = recordsCount;
//   }
// 
//   @JsonAnySetter
//   public void setMap(String key, CycleDto cycleDto) {
//     map.put(key, cycleDto);
//   }
// 
//   @JsonAnyGetter
//   public Map<String, CycleDto> getMap() {
//     return map;
//   }
// }
// 
// Path: src/main/java/com/frameworkium/core/common/reporting/jira/service/AbstractJiraService.java
// public abstract class AbstractJiraService extends BaseService {
//   @Override
//   protected RequestSpecification getRequestSpec() {
//     return RestAssured.given().log().ifValidationFails()
//         .baseUri(JiraEndpoint.BASE_URI.getUrl())
//         .config(config())
//         .relaxedHTTPSValidation()
//         .auth().preemptive().basic(
//             Property.JIRA_USERNAME.getValue(),
//             Property.JIRA_PASSWORD.getValue());
//   }
// 
//   @Override
//   protected ResponseSpecification getResponseSpec() {
//     throw new UnsupportedOperationException("Unimplemented");
//   }
// 
//   private RestAssuredConfig config() {
//     return RestAssuredConfig.config().objectMapperConfig(
//         ObjectMapperConfig.objectMapperConfig().jackson2ObjectMapperFactory(
//             (type, s) -> {
//               final ObjectMapper objectMapper = new ObjectMapper();
//               objectMapper.registerModule(new JavaTimeModule());
//               objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
//               objectMapper.setVisibility(PropertyAccessor.GETTER, JsonAutoDetect.Visibility.NONE);
//               objectMapper.setVisibility(PropertyAccessor.SETTER, JsonAutoDetect.Visibility.NONE);
//               objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
//               objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
//               return objectMapper;
//             }
//         )
//     );
//   }
// }


import static org.apache.http.HttpStatus.SC_OK;
import com.frameworkium.core.common.reporting.jira.dto.cycle.CreateCycleSuccessDto;
import com.frameworkium.core.common.reporting.jira.dto.cycle.CreateNewCycleDto;
import com.frameworkium.core.common.reporting.jira.dto.cycle.CycleListDto;
import com.frameworkium.core.common.reporting.jira.endpoint.ZephyrEndpoint;
import com.frameworkium.core.common.reporting.jira.service.AbstractJiraService;
package com.frameworkium.core.common.reporting.jira.zapi;



public class Cycle extends AbstractJiraService {
  public CycleListDto getListOfCycle(Long projectId, Long versionId) {
    return getRequestSpec()
        .basePath(ZephyrEndpoint.CYCLE.getUrl())
        .queryParam("projectId", projectId)
        .queryParam("versionId", versionId)
        .get()
        .then()
        .log().ifValidationFails()
        .statusCode(SC_OK)
        .extract().body()
        .as(CycleListDto.class);
  }

// Path: src/main/java/com/frameworkium/core/common/reporting/jira/dto/cycle/CreateCycleSuccessDto.java
// public class CreateCycleSuccessDto extends AbstractDTO<CreateCycleSuccessDto> {
//   public String id;
//   public String responseMessage;
// }
// 
// Path: src/main/java/com/frameworkium/core/common/reporting/jira/dto/cycle/CreateNewCycleDto.java
// @JsonDeserialize(builder = CreateNewCycleDto.Builder.class)
// public class CreateNewCycleDto extends AbstractDTO<CreateNewCycleDto> {
//   @JsonUnwrapped
//   public CycleLightDto cycleLightDto;
//   public String cloneCycleId;
//   public String sprintId;
// 
//   private CreateNewCycleDto(final Builder builder) {
//     cycleLightDto = builder.cycleLightDto;
//     cloneCycleId = builder.cloneCycleId;
//     sprintId = builder.sprintId;
//   }
// 
//   public static Builder newBuilder() {
//     return new Builder();
//   }
// 
//   @JsonPOJOBuilder(withPrefix = "")
//   public static final class Builder {
//     @JsonUnwrapped
//     private CycleLightDto cycleLightDto;
//     private String cloneCycleId;
//     private String sprintId;
// 
//     private Builder() {
//     }
// 
//     public Builder cycleLightDto(final CycleLightDto cycleLightDto) {
//       this.cycleLightDto = cycleLightDto;
//       return this;
//     }
// 
//     public Builder cloneCycleId(final String cloneCycleId) {
//       this.cloneCycleId = cloneCycleId;
//       return this;
//     }
// 
//     public Builder sprintId(final String sprintId) {
//       this.sprintId = sprintId;
//       return this;
//     }
// 
//     public CreateNewCycleDto build() {
//       return new CreateNewCycleDto(this);
//     }
//   }
// }
// 
// Path: src/main/java/com/frameworkium/core/common/reporting/jira/dto/cycle/CycleListDto.java
// public class CycleListDto extends AbstractDTO<CycleListDto> {
//   public Map<String, CycleDto> map = new HashMap<>();
//   public Long recordsCount;
// 
//   @JsonCreator
//   public CycleListDto(@JsonProperty("recordsCount") Long recordsCount) {
//     this.recordsCount = recordsCount;
//   }
// 
//   @JsonAnySetter
//   public void setMap(String key, CycleDto cycleDto) {
//     map.put(key, cycleDto);
//   }
// 
//   @JsonAnyGetter
//   public Map<String, CycleDto> getMap() {
//     return map;
//   }
// }
// 
// Path: src/main/java/com/frameworkium/core/common/reporting/jira/service/AbstractJiraService.java
// public abstract class AbstractJiraService extends BaseService {
//   @Override
//   protected RequestSpecification getRequestSpec() {
//     return RestAssured.given().log().ifValidationFails()
//         .baseUri(JiraEndpoint.BASE_URI.getUrl())
//         .config(config())
//         .relaxedHTTPSValidation()
//         .auth().preemptive().basic(
//             Property.JIRA_USERNAME.getValue(),
//             Property.JIRA_PASSWORD.getValue());
//   }
// 
//   @Override
//   protected ResponseSpecification getResponseSpec() {
//     throw new UnsupportedOperationException("Unimplemented");
//   }
// 
//   private RestAssuredConfig config() {
//     return RestAssuredConfig.config().objectMapperConfig(
//         ObjectMapperConfig.objectMapperConfig().jackson2ObjectMapperFactory(
//             (type, s) -> {
//               final ObjectMapper objectMapper = new ObjectMapper();
//               objectMapper.registerModule(new JavaTimeModule());
//               objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
//               objectMapper.setVisibility(PropertyAccessor.GETTER, JsonAutoDetect.Visibility.NONE);
//               objectMapper.setVisibility(PropertyAccessor.SETTER, JsonAutoDetect.Visibility.NONE);
//               objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
//               objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
//               return objectMapper;
//             }
//         )
//     );
//   }
// }


// Path: src/main/java/com/frameworkium/core/common/reporting/jira/zapi/Cycle.java
import static org.apache.http.HttpStatus.SC_OK;
import com.frameworkium.core.common.reporting.jira.dto.cycle.CreateCycleSuccessDto;
import com.frameworkium.core.common.reporting.jira.dto.cycle.CreateNewCycleDto;
import com.frameworkium.core.common.reporting.jira.dto.cycle.CycleListDto;
import com.frameworkium.core.common.reporting.jira.endpoint.ZephyrEndpoint;
import com.frameworkium.core.common.reporting.jira.service.AbstractJiraService;

package com.frameworkium.core.common.reporting.jira.zapi;



public class Cycle extends AbstractJiraService {
  public CycleListDto getListOfCycle(Long projectId, Long versionId) {
    return getRequestSpec()
        .basePath(ZephyrEndpoint.CYCLE.getUrl())
        .queryParam("projectId", projectId)
        .queryParam("versionId", versionId)
        .get()
        .then()
        .log().ifValidationFails()
        .statusCode(SC_OK)
        .extract().body()
        .as(CycleListDto.class);
  }

  public CreateCycleSuccessDto createNewCycle(CreateNewCycleDto createNewCycleDto) {