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

com.cohere.api.resources.finetuning.requests.FinetuningUpdateFinetunedModelRequest Maven / Gradle / Ivy

There is a newer version: 1.6.0
Show newest version
/**
 * This file was auto-generated by Fern from our API Definition.
 */
package com.cohere.api.resources.finetuning.requests;

import com.cohere.api.core.ObjectMappers;
import com.cohere.api.resources.finetuning.finetuning.types.Settings;
import com.cohere.api.resources.finetuning.finetuning.types.Status;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonDeserialize(builder = FinetuningUpdateFinetunedModelRequest.Builder.class)
public final class FinetuningUpdateFinetunedModelRequest {
    private final String name;

    private final Optional creatorId;

    private final Optional organizationId;

    private final Settings settings;

    private final Optional status;

    private final Optional createdAt;

    private final Optional updatedAt;

    private final Optional completedAt;

    private final Optional lastUsed;

    private final Map additionalProperties;

    private FinetuningUpdateFinetunedModelRequest(
            String name,
            Optional creatorId,
            Optional organizationId,
            Settings settings,
            Optional status,
            Optional createdAt,
            Optional updatedAt,
            Optional completedAt,
            Optional lastUsed,
            Map additionalProperties) {
        this.name = name;
        this.creatorId = creatorId;
        this.organizationId = organizationId;
        this.settings = settings;
        this.status = status;
        this.createdAt = createdAt;
        this.updatedAt = updatedAt;
        this.completedAt = completedAt;
        this.lastUsed = lastUsed;
        this.additionalProperties = additionalProperties;
    }

    /**
     * @return FinetunedModel name (e.g. foobar).
     */
    @JsonProperty("name")
    public String getName() {
        return name;
    }

    /**
     * @return User ID of the creator.
     */
    @JsonProperty("creator_id")
    public Optional getCreatorId() {
        return creatorId;
    }

    /**
     * @return Organization ID.
     */
    @JsonProperty("organization_id")
    public Optional getOrganizationId() {
        return organizationId;
    }

    /**
     * @return FinetunedModel settings such as dataset, hyperparameters...
     */
    @JsonProperty("settings")
    public Settings getSettings() {
        return settings;
    }

    /**
     * @return Current stage in the life-cycle of the fine-tuned model.
     */
    @JsonProperty("status")
    public Optional getStatus() {
        return status;
    }

    /**
     * @return Creation timestamp.
     */
    @JsonProperty("created_at")
    public Optional getCreatedAt() {
        return createdAt;
    }

    /**
     * @return Latest update timestamp.
     */
    @JsonProperty("updated_at")
    public Optional getUpdatedAt() {
        return updatedAt;
    }

    /**
     * @return Timestamp for the completed fine-tuning.
     */
    @JsonProperty("completed_at")
    public Optional getCompletedAt() {
        return completedAt;
    }

    /**
     * @return Timestamp for the latest request to this fine-tuned model.
     */
    @JsonProperty("last_used")
    public Optional getLastUsed() {
        return lastUsed;
    }

    @java.lang.Override
    public boolean equals(Object other) {
        if (this == other) return true;
        return other instanceof FinetuningUpdateFinetunedModelRequest
                && equalTo((FinetuningUpdateFinetunedModelRequest) other);
    }

    @JsonAnyGetter
    public Map getAdditionalProperties() {
        return this.additionalProperties;
    }

    private boolean equalTo(FinetuningUpdateFinetunedModelRequest other) {
        return name.equals(other.name)
                && creatorId.equals(other.creatorId)
                && organizationId.equals(other.organizationId)
                && settings.equals(other.settings)
                && status.equals(other.status)
                && createdAt.equals(other.createdAt)
                && updatedAt.equals(other.updatedAt)
                && completedAt.equals(other.completedAt)
                && lastUsed.equals(other.lastUsed);
    }

    @java.lang.Override
    public int hashCode() {
        return Objects.hash(
                this.name,
                this.creatorId,
                this.organizationId,
                this.settings,
                this.status,
                this.createdAt,
                this.updatedAt,
                this.completedAt,
                this.lastUsed);
    }

    @java.lang.Override
    public String toString() {
        return ObjectMappers.stringify(this);
    }

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

    public interface NameStage {
        SettingsStage name(String name);

        Builder from(FinetuningUpdateFinetunedModelRequest other);
    }

    public interface SettingsStage {
        _FinalStage settings(Settings settings);
    }

    public interface _FinalStage {
        FinetuningUpdateFinetunedModelRequest build();

        _FinalStage creatorId(Optional creatorId);

        _FinalStage creatorId(String creatorId);

        _FinalStage organizationId(Optional organizationId);

        _FinalStage organizationId(String organizationId);

        _FinalStage status(Optional status);

        _FinalStage status(Status status);

        _FinalStage createdAt(Optional createdAt);

        _FinalStage createdAt(OffsetDateTime createdAt);

        _FinalStage updatedAt(Optional updatedAt);

        _FinalStage updatedAt(OffsetDateTime updatedAt);

        _FinalStage completedAt(Optional completedAt);

        _FinalStage completedAt(OffsetDateTime completedAt);

        _FinalStage lastUsed(Optional lastUsed);

        _FinalStage lastUsed(OffsetDateTime lastUsed);
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static final class Builder implements NameStage, SettingsStage, _FinalStage {
        private String name;

        private Settings settings;

        private Optional lastUsed = Optional.empty();

        private Optional completedAt = Optional.empty();

        private Optional updatedAt = Optional.empty();

        private Optional createdAt = Optional.empty();

        private Optional status = Optional.empty();

        private Optional organizationId = Optional.empty();

        private Optional creatorId = Optional.empty();

        @JsonAnySetter
        private Map additionalProperties = new HashMap<>();

        private Builder() {}

        @java.lang.Override
        public Builder from(FinetuningUpdateFinetunedModelRequest other) {
            name(other.getName());
            creatorId(other.getCreatorId());
            organizationId(other.getOrganizationId());
            settings(other.getSettings());
            status(other.getStatus());
            createdAt(other.getCreatedAt());
            updatedAt(other.getUpdatedAt());
            completedAt(other.getCompletedAt());
            lastUsed(other.getLastUsed());
            return this;
        }

        /**
         * 

FinetunedModel name (e.g. foobar).

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("name") public SettingsStage name(String name) { this.name = name; return this; } /** *

FinetunedModel settings such as dataset, hyperparameters...

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("settings") public _FinalStage settings(Settings settings) { this.settings = settings; return this; } /** *

Timestamp for the latest request to this fine-tuned model.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage lastUsed(OffsetDateTime lastUsed) { this.lastUsed = Optional.of(lastUsed); return this; } @java.lang.Override @JsonSetter(value = "last_used", nulls = Nulls.SKIP) public _FinalStage lastUsed(Optional lastUsed) { this.lastUsed = lastUsed; return this; } /** *

Timestamp for the completed fine-tuning.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage completedAt(OffsetDateTime completedAt) { this.completedAt = Optional.of(completedAt); return this; } @java.lang.Override @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) public _FinalStage completedAt(Optional completedAt) { this.completedAt = completedAt; return this; } /** *

Latest update timestamp.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage updatedAt(OffsetDateTime updatedAt) { this.updatedAt = Optional.of(updatedAt); return this; } @java.lang.Override @JsonSetter(value = "updated_at", nulls = Nulls.SKIP) public _FinalStage updatedAt(Optional updatedAt) { this.updatedAt = updatedAt; return this; } /** *

Creation timestamp.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage createdAt(OffsetDateTime createdAt) { this.createdAt = Optional.of(createdAt); return this; } @java.lang.Override @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public _FinalStage createdAt(Optional createdAt) { this.createdAt = createdAt; return this; } /** *

Current stage in the life-cycle of the fine-tuned model.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage status(Status status) { this.status = Optional.of(status); return this; } @java.lang.Override @JsonSetter(value = "status", nulls = Nulls.SKIP) public _FinalStage status(Optional status) { this.status = status; return this; } /** *

Organization ID.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage organizationId(String organizationId) { this.organizationId = Optional.of(organizationId); return this; } @java.lang.Override @JsonSetter(value = "organization_id", nulls = Nulls.SKIP) public _FinalStage organizationId(Optional organizationId) { this.organizationId = organizationId; return this; } /** *

User ID of the creator.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage creatorId(String creatorId) { this.creatorId = Optional.of(creatorId); return this; } @java.lang.Override @JsonSetter(value = "creator_id", nulls = Nulls.SKIP) public _FinalStage creatorId(Optional creatorId) { this.creatorId = creatorId; return this; } @java.lang.Override public FinetuningUpdateFinetunedModelRequest build() { return new FinetuningUpdateFinetunedModelRequest( name, creatorId, organizationId, settings, status, createdAt, updatedAt, completedAt, lastUsed, additionalProperties); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy