All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.circleci.client.v2.model.PipelineWithWorkflows Maven / Gradle / Ivy

There is a newer version: 2.0.138
Show newest version
/*
 * CircleCI API
 * This describes the resources that make up the CircleCI API v2. API v2 is currently in Preview. Additional documentation for this API can be found in the [API Preview Docs](https://github.com/CircleCI-Public/api-preview-docs/tree/master/docs). Breaking changes to the API will be announced in the [Breaking Changes log](https://github.com/CircleCI-Public/api-preview-docs/blob/master/docs/breaking.md).
 *
 * The version of the OpenAPI document: v2
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.circleci.client.v2.model;

import java.util.Objects;
import java.util.Arrays;
import com.circleci.client.v2.model.PipelineWithWorkflowsErrors;
import com.circleci.client.v2.model.PipelineWithWorkflowsTrigger;
import com.circleci.client.v2.model.PipelineWithWorkflowsVcs;
import com.circleci.client.v2.model.PipelineWithWorkflowsWorkflows;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * NOTE: The definition of pipeline is subject to change.
 */
@ApiModel(description = "NOTE: The definition of pipeline is subject to change.")

public class PipelineWithWorkflows {
  public static final String JSON_PROPERTY_WORKFLOWS = "workflows";
  @JsonProperty(JSON_PROPERTY_WORKFLOWS)
  private List workflows = new ArrayList<>();

  public static final String JSON_PROPERTY_ID = "id";
  @JsonProperty(JSON_PROPERTY_ID)
  private UUID id;

  public static final String JSON_PROPERTY_ERRORS = "errors";
  @JsonProperty(JSON_PROPERTY_ERRORS)
  private List errors = new ArrayList<>();

  public static final String JSON_PROPERTY_PROJECT_SLUG = "project_slug";
  @JsonProperty(JSON_PROPERTY_PROJECT_SLUG)
  private String projectSlug;

  public static final String JSON_PROPERTY_UPDATED_AT = "updated_at";
  @JsonProperty(JSON_PROPERTY_UPDATED_AT)
  private OffsetDateTime updatedAt;

  public static final String JSON_PROPERTY_NUMBER = "number";
  @JsonProperty(JSON_PROPERTY_NUMBER)
  private Long number;

  /**
   * The current state of the pipeline.
   */
  public enum StateEnum {
    CREATED("created"),
    
    ERRORED("errored"),
    
    PENDING("pending");

    private String value;

    StateEnum(String value) {
      this.value = value;
    }

    @JsonValue
    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    @JsonCreator
    public static StateEnum fromValue(String value) {
      for (StateEnum b : StateEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }
  }

  public static final String JSON_PROPERTY_STATE = "state";
  @JsonProperty(JSON_PROPERTY_STATE)
  private StateEnum state;

  public static final String JSON_PROPERTY_CREATED_AT = "created_at";
  @JsonProperty(JSON_PROPERTY_CREATED_AT)
  private OffsetDateTime createdAt;

  public static final String JSON_PROPERTY_TRIGGER = "trigger";
  @JsonProperty(JSON_PROPERTY_TRIGGER)
  private PipelineWithWorkflowsTrigger trigger = null;

  public static final String JSON_PROPERTY_VCS = "vcs";
  @JsonProperty(JSON_PROPERTY_VCS)
  private PipelineWithWorkflowsVcs vcs = null;

  public PipelineWithWorkflows workflows(List workflows) {
    this.workflows = workflows;
    return this;
  }

  public PipelineWithWorkflows addWorkflowsItem(PipelineWithWorkflowsWorkflows workflowsItem) {
    if (this.workflows == null) {
      this.workflows = new ArrayList<>();
    }
    this.workflows.add(workflowsItem);
    return this;
  }

   /**
   * DEPRECATION NOTICE: workflows will shortly be removed from pipeline response.
   * @return workflows
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "DEPRECATION NOTICE: workflows will shortly be removed from pipeline response.")
  public List getWorkflows() {
    return workflows;
  }

  public void setWorkflows(List workflows) {
    this.workflows = workflows;
  }

  public PipelineWithWorkflows id(UUID id) {
    this.id = id;
    return this;
  }

   /**
   * The unique ID of the pipeline.
   * @return id
  **/
  @ApiModelProperty(required = true, value = "The unique ID of the pipeline.")
  public UUID getId() {
    return id;
  }

  public void setId(UUID id) {
    this.id = id;
  }

  public PipelineWithWorkflows errors(List errors) {
    this.errors = errors;
    return this;
  }

  public PipelineWithWorkflows addErrorsItem(PipelineWithWorkflowsErrors errorsItem) {
    this.errors.add(errorsItem);
    return this;
  }

   /**
   * A sequence of errors that have occurred within the pipeline.
   * @return errors
  **/
  @ApiModelProperty(required = true, value = "A sequence of errors that have occurred within the pipeline.")
  public List getErrors() {
    return errors;
  }

  public void setErrors(List errors) {
    this.errors = errors;
  }

  public PipelineWithWorkflows projectSlug(String projectSlug) {
    this.projectSlug = projectSlug;
    return this;
  }

   /**
   * The project-slug for the pipeline.
   * @return projectSlug
  **/
  @ApiModelProperty(example = "gh/CircleCI-Public/api-preview-docs", required = true, value = "The project-slug for the pipeline.")
  public String getProjectSlug() {
    return projectSlug;
  }

  public void setProjectSlug(String projectSlug) {
    this.projectSlug = projectSlug;
  }

  public PipelineWithWorkflows updatedAt(OffsetDateTime updatedAt) {
    this.updatedAt = updatedAt;
    return this;
  }

   /**
   * The date and time the pipeline was last updated.
   * @return updatedAt
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The date and time the pipeline was last updated.")
  public OffsetDateTime getUpdatedAt() {
    return updatedAt;
  }

  public void setUpdatedAt(OffsetDateTime updatedAt) {
    this.updatedAt = updatedAt;
  }

  public PipelineWithWorkflows number(Long number) {
    this.number = number;
    return this;
  }

   /**
   * The number of the pipeline.
   * @return number
  **/
  @ApiModelProperty(required = true, value = "The number of the pipeline.")
  public Long getNumber() {
    return number;
  }

  public void setNumber(Long number) {
    this.number = number;
  }

  public PipelineWithWorkflows state(StateEnum state) {
    this.state = state;
    return this;
  }

   /**
   * The current state of the pipeline.
   * @return state
  **/
  @ApiModelProperty(required = true, value = "The current state of the pipeline.")
  public StateEnum getState() {
    return state;
  }

  public void setState(StateEnum state) {
    this.state = state;
  }

  public PipelineWithWorkflows createdAt(OffsetDateTime createdAt) {
    this.createdAt = createdAt;
    return this;
  }

   /**
   * The date and time the pipeline was created.
   * @return createdAt
  **/
  @ApiModelProperty(required = true, value = "The date and time the pipeline was created.")
  public OffsetDateTime getCreatedAt() {
    return createdAt;
  }

  public void setCreatedAt(OffsetDateTime createdAt) {
    this.createdAt = createdAt;
  }

  public PipelineWithWorkflows trigger(PipelineWithWorkflowsTrigger trigger) {
    this.trigger = trigger;
    return this;
  }

   /**
   * Get trigger
   * @return trigger
  **/
  @ApiModelProperty(required = true, value = "")
  public PipelineWithWorkflowsTrigger getTrigger() {
    return trigger;
  }

  public void setTrigger(PipelineWithWorkflowsTrigger trigger) {
    this.trigger = trigger;
  }

  public PipelineWithWorkflows vcs(PipelineWithWorkflowsVcs vcs) {
    this.vcs = vcs;
    return this;
  }

   /**
   * Get vcs
   * @return vcs
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")
  public PipelineWithWorkflowsVcs getVcs() {
    return vcs;
  }

  public void setVcs(PipelineWithWorkflowsVcs vcs) {
    this.vcs = vcs;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PipelineWithWorkflows pipelineWithWorkflows = (PipelineWithWorkflows) o;
    return Objects.equals(this.workflows, pipelineWithWorkflows.workflows) &&
        Objects.equals(this.id, pipelineWithWorkflows.id) &&
        Objects.equals(this.errors, pipelineWithWorkflows.errors) &&
        Objects.equals(this.projectSlug, pipelineWithWorkflows.projectSlug) &&
        Objects.equals(this.updatedAt, pipelineWithWorkflows.updatedAt) &&
        Objects.equals(this.number, pipelineWithWorkflows.number) &&
        Objects.equals(this.state, pipelineWithWorkflows.state) &&
        Objects.equals(this.createdAt, pipelineWithWorkflows.createdAt) &&
        Objects.equals(this.trigger, pipelineWithWorkflows.trigger) &&
        Objects.equals(this.vcs, pipelineWithWorkflows.vcs);
  }

  @Override
  public int hashCode() {
    return Objects.hash(workflows, id, errors, projectSlug, updatedAt, number, state, createdAt, trigger, vcs);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PipelineWithWorkflows {\n");
    sb.append("    workflows: ").append(toIndentedString(workflows)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    errors: ").append(toIndentedString(errors)).append("\n");
    sb.append("    projectSlug: ").append(toIndentedString(projectSlug)).append("\n");
    sb.append("    updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
    sb.append("    number: ").append(toIndentedString(number)).append("\n");
    sb.append("    state: ").append(toIndentedString(state)).append("\n");
    sb.append("    createdAt: ").append(toIndentedString(createdAt)).append("\n");
    sb.append("    trigger: ").append(toIndentedString(trigger)).append("\n");
    sb.append("    vcs: ").append(toIndentedString(vcs)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy