package ai.sentryagent.idp.models;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/**
 * Request body for PATCH /api/v1/agents/:id.
 * All fields are optional — null fields are omitted from the JSON body.
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public final class UpdateAgentRequest {

    @JsonProperty("agentType")     private final String agentType;
    @JsonProperty("version")       private final String version;
    @JsonProperty("capabilities")  private final List<String> capabilities;
    @JsonProperty("owner")         private final String owner;
    @JsonProperty("deploymentEnv") private final String deploymentEnv;
    @JsonProperty("status")        private final String status;

    private UpdateAgentRequest(Builder b) {
        this.agentType     = b.agentType;
        this.version       = b.version;
        this.capabilities  = b.capabilities;
        this.owner         = b.owner;
        this.deploymentEnv = b.deploymentEnv;
        this.status        = b.status;
    }

    public String getAgentType()            { return agentType; }
    public String getVersion()              { return version; }
    public List<String> getCapabilities()   { return capabilities; }
    public String getOwner()               { return owner; }
    public String getDeploymentEnv()        { return deploymentEnv; }
    public String getStatus()              { return status; }

    public static Builder builder() { return new Builder(); }

    public static final class Builder {
        private String agentType;
        private String version;
        private List<String> capabilities;
        private String owner;
        private String deploymentEnv;
        private String status;

        public Builder agentType(String agentType)              { this.agentType = agentType;       return this; }
        public Builder version(String version)                  { this.version = version;           return this; }
        public Builder capabilities(List<String> capabilities)  { this.capabilities = capabilities; return this; }
        public Builder owner(String owner)                      { this.owner = owner;               return this; }
        public Builder deploymentEnv(String deploymentEnv)      { this.deploymentEnv = deploymentEnv; return this; }
        public Builder status(String status)                    { this.status = status;             return this; }

        public UpdateAgentRequest build() { return new UpdateAgentRequest(this); }
    }
}
