io.github.primelib.jira4j.restv3.spec.EditIssueOperationSpec Maven / Gradle / Ivy
Show all versions of jira4j-rest-v3 Show documentation
package io.github.primelib.jira4j.restv3.spec;
import java.util.Objects;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.annotation.processing.Generated;
import io.github.primelib.jira4j.restv3.model.IssueUpdateDetails;
import io.github.primelib.jira4j.restv3.model.Screen;
import java.util.Set;
import io.github.primelib.jira4j.restv3.model.User;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.util.function.Consumer;
/**
* EditIssueSpec
*
* Specification for the EditIssue operation.
*
* Edit issue
*/
@Getter
@Setter
@EqualsAndHashCode
@ToString
@Accessors(fluent = true, chain = true)
@NoArgsConstructor(access = AccessLevel.PROTECTED, force = true)
@Builder
@Generated(value = "io.github.primelib.primecodegen.javafeign.JavaFeignGenerator")
public class EditIssueOperationSpec {
/**
* allows to disable validation of the spec, use with care!
*/
@ApiStatus.Experimental
public static Boolean VALIDATION_ENABLED = true;
/**
* The ID or key of the issue.
*/
@NotNull
private String issueIdOrKey;
/**
*/
@NotNull
private IssueUpdateDetails issueUpdateDetails;
/**
* Whether a notification email about the issue update is sent to all watchers. To disable the notification, administer Jira or administer project permissions are required. If the user doesn't have the necessary permission the request is ignored.
*/
@Nullable
private Boolean notifyUsers;
/**
* Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
@Nullable
private Boolean overrideScreenSecurity;
/**
* Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
@Nullable
private Boolean overrideEditableFlag;
/**
* Whether the response should contain the issue with fields edited in this request. The returned issue will have the same format as in the [Get issue API](#api-rest-api-3-issue-issueidorkey-get).
*/
@Nullable
private Boolean returnIssue;
/**
* The Get issue API expand parameter to use in the response if the {@code returnIssue} parameter is {@code true}.
*/
@Nullable
private String expand;
/**
* Constructs a validated instance of {@link EditIssueOperationSpec}.
*
* @param spec the specification to process
*/
@ApiStatus.Internal
public EditIssueOperationSpec(Consumer spec) {
spec.accept(this);
if (VALIDATION_ENABLED)
validate();
}
/**
* Constructs a validated instance of {@link EditIssueOperationSpec}.
*
* NOTE: This constructor is not considered stable and may change if the operation is updated.
* @param issueIdOrKey The ID or key of the issue.
* @param issueUpdateDetails
* @param notifyUsers Whether a notification email about the issue update is sent to all watchers. To disable the notification, administer Jira or administer project permissions are required. If the user doesn't have the necessary permission the request is ignored.
* @param overrideScreenSecurity Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
* @param overrideEditableFlag Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
* @param returnIssue Whether the response should contain the issue with fields edited in this request. The returned issue will have the same format as in the [Get issue API](#api-rest-api-3-issue-issueidorkey-get).
* @param expand The Get issue API expand parameter to use in the response if the {@code returnIssue} parameter is {@code true}.
*/
@ApiStatus.Internal
public EditIssueOperationSpec(String issueIdOrKey, IssueUpdateDetails issueUpdateDetails, Boolean notifyUsers, Boolean overrideScreenSecurity, Boolean overrideEditableFlag, Boolean returnIssue, String expand) {
this.issueIdOrKey = issueIdOrKey;
this.issueUpdateDetails = issueUpdateDetails;
this.notifyUsers = notifyUsers;
this.overrideScreenSecurity = overrideScreenSecurity;
this.overrideEditableFlag = overrideEditableFlag;
this.returnIssue = returnIssue;
this.expand = expand;
if (VALIDATION_ENABLED)
validate();
}
/**
* Validates the Spec, will throw a exception if required parameters are missing
*
* @throws NullPointerException
*/
public void validate() {
Objects.requireNonNull(issueIdOrKey, "issueIdOrKey is a required parameter!");
Objects.requireNonNull(issueUpdateDetails, "issueUpdateDetails is a required parameter!");
}
}