Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,343 @@
/*
* Internal Orchestration Service API
* Orchestration is an inference service which provides common additional capabilities for business AI scenarios, such as content filtering and data masking. At the core of the service is the LLM module which allows for an easy, harmonized access to the language models of gen AI hub. The service is designed to be modular and extensible, allowing for the addition of new modules in the future. Each module can be configured independently and at runtime, allowing for a high degree of flexibility in the orchestration of AI services.
*
*
*
* 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.sap.ai.sdk.orchestration.model;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/** Citation */
// CHECKSTYLE:OFF
public class Citation
// CHECKSTYLE:ON
{
@JsonProperty("ref_id")
private Integer refId;

@JsonProperty("title")
private String title;

@JsonProperty("url")
private String url;

@JsonProperty("start_index")
private Integer startIndex;

@JsonProperty("end_index")
private Integer endIndex;

@JsonAnySetter @JsonAnyGetter
private final Map<String, Object> cloudSdkCustomFields = new LinkedHashMap<>();

/** Default constructor for Citation. */
protected Citation() {}

/**
* Set the refId of this {@link Citation} instance and return the same instance.
*
* @param refId Unique identifier for inline citation
* @return The same instance of this {@link Citation} class
*/
@Nonnull
public Citation refId(@Nullable final Integer refId) {
this.refId = refId;
return this;
}

/**
* Unique identifier for inline citation
*
* @return refId The refId of this {@link Citation} instance.
*/
@Nonnull
public Integer getRefId() {
return refId;
}

/**
* Set the refId of this {@link Citation} instance.
*
* @param refId Unique identifier for inline citation
*/
public void setRefId(@Nullable final Integer refId) {
this.refId = refId;
}

/**
* Set the title of this {@link Citation} instance and return the same instance.
*
* @param title Title of the citation
* @return The same instance of this {@link Citation} class
*/
@Nonnull
public Citation title(@Nonnull final String title) {
this.title = title;
return this;
}

/**
* Title of the citation
*
* @return title The title of this {@link Citation} instance.
*/
@Nonnull
public String getTitle() {
return title;
}

/**
* Set the title of this {@link Citation} instance.
*
* @param title Title of the citation
*/
public void setTitle(@Nonnull final String title) {
this.title = title;
}

/**
* Set the url of this {@link Citation} instance and return the same instance.
*
* @param url URL of the citation
* @return The same instance of this {@link Citation} class
*/
@Nonnull
public Citation url(@Nonnull final String url) {
this.url = url;
return this;
}

/**
* URL of the citation
*
* @return url The url of this {@link Citation} instance.
*/
@Nonnull
public String getUrl() {
return url;
}

/**
* Set the url of this {@link Citation} instance.
*
* @param url URL of the citation
*/
public void setUrl(@Nonnull final String url) {
this.url = url;
}

/**
* Set the startIndex of this {@link Citation} instance and return the same instance.
*
* @param startIndex Start index of the citation in the response text
* @return The same instance of this {@link Citation} class
*/
@Nonnull
public Citation startIndex(@Nullable final Integer startIndex) {
this.startIndex = startIndex;
return this;
}

/**
* Start index of the citation in the response text
*
* @return startIndex The startIndex of this {@link Citation} instance.
*/
@Nonnull
public Integer getStartIndex() {
return startIndex;
}

/**
* Set the startIndex of this {@link Citation} instance.
*
* @param startIndex Start index of the citation in the response text
*/
public void setStartIndex(@Nullable final Integer startIndex) {
this.startIndex = startIndex;
}

/**
* Set the endIndex of this {@link Citation} instance and return the same instance.
*
* @param endIndex End index of the citation in the response text
* @return The same instance of this {@link Citation} class
*/
@Nonnull
public Citation endIndex(@Nullable final Integer endIndex) {
this.endIndex = endIndex;
return this;
}

/**
* End index of the citation in the response text
*
* @return endIndex The endIndex of this {@link Citation} instance.
*/
@Nonnull
public Integer getEndIndex() {
return endIndex;
}

/**
* Set the endIndex of this {@link Citation} instance.
*
* @param endIndex End index of the citation in the response text
*/
public void setEndIndex(@Nullable final Integer endIndex) {
this.endIndex = endIndex;
}

/**
* Get the names of the unrecognizable properties of the {@link Citation}.
*
* @return The set of properties names
*/
@JsonIgnore
@Nonnull
public Set<String> getCustomFieldNames() {
return cloudSdkCustomFields.keySet();
}

/**
* Get the value of an unrecognizable property of this {@link Citation} instance.
*
* @deprecated Use {@link #toMap()} instead.
* @param name The name of the property
* @return The value of the property
* @throws NoSuchElementException If no property with the given name could be found.
*/
@Nullable
@Deprecated
public Object getCustomField(@Nonnull final String name) throws NoSuchElementException {
if (!cloudSdkCustomFields.containsKey(name)) {
throw new NoSuchElementException("Citation has no field with name '" + name + "'.");
}
return cloudSdkCustomFields.get(name);
}

/**
* Get the value of all properties of this {@link Citation} instance including unrecognized
* properties.
*
* @return The map of all properties
*/
@JsonIgnore
@Nonnull
public Map<String, Object> toMap() {
final Map<String, Object> declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
if (refId != null) declaredFields.put("refId", refId);
if (title != null) declaredFields.put("title", title);
if (url != null) declaredFields.put("url", url);
if (startIndex != null) declaredFields.put("startIndex", startIndex);
if (endIndex != null) declaredFields.put("endIndex", endIndex);
return declaredFields;
}

/**
* Set an unrecognizable property of this {@link Citation} instance. If the map previously
* contained a mapping for the key, the old value is replaced by the specified value.
*
* @param customFieldName The name of the property
* @param customFieldValue The value of the property
*/
@JsonIgnore
public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) {
cloudSdkCustomFields.put(customFieldName, customFieldValue);
}

@Override
public boolean equals(@Nullable final java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final Citation citation = (Citation) o;
return Objects.equals(this.cloudSdkCustomFields, citation.cloudSdkCustomFields)
&& Objects.equals(this.refId, citation.refId)
&& Objects.equals(this.title, citation.title)
&& Objects.equals(this.url, citation.url)
&& Objects.equals(this.startIndex, citation.startIndex)
&& Objects.equals(this.endIndex, citation.endIndex);
}

@Override
public int hashCode() {
return Objects.hash(refId, title, url, startIndex, endIndex, cloudSdkCustomFields);
}

@Override
@Nonnull
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("class Citation {\n");
sb.append(" refId: ").append(toIndentedString(refId)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append(" startIndex: ").append(toIndentedString(startIndex)).append("\n");
sb.append(" endIndex: ").append(toIndentedString(endIndex)).append("\n");
cloudSdkCustomFields.forEach(
(k, v) ->
sb.append(" ").append(k).append(": ").append(toIndentedString(v)).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(final java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}

/**
* Create a type-safe, fluent-api builder object to construct a new {@link Citation} instance with
* all required arguments.
*/
public static Builder create() {
return (title) -> (url) -> new Citation().title(title).url(url);
}

/** Builder helper class. */
public interface Builder {
/**
* Set the title of this {@link Citation} instance.
*
* @param title Title of the citation
* @return The Citation builder.
*/
Builder1 title(@Nonnull final String title);
}

/** Builder helper class. */
public interface Builder1 {
/**
* Set the url of this {@link Citation} instance.
*
* @param url URL of the citation
* @return The Citation instance.
*/
Citation url(@Nonnull final String url);
}
}
Loading
Loading