-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f16dec
commit 72e0cd7
Showing
16 changed files
with
788 additions
and
104 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
130 changes: 91 additions & 39 deletions
130
src/main/java/com/cohere/api/requests/ChatStreamRequest.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
163 changes: 163 additions & 0 deletions
163
src/main/java/com/cohere/api/types/CheckApiKeyResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.cohere.api.types; | ||
|
||
import com.cohere.api.core.ObjectMappers; | ||
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.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
import java.util.Optional; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
@JsonDeserialize(builder = CheckApiKeyResponse.Builder.class) | ||
public final class CheckApiKeyResponse { | ||
private final boolean valid; | ||
|
||
private final Optional<String> organizationId; | ||
|
||
private final Optional<String> ownerId; | ||
|
||
private final Map<String, Object> additionalProperties; | ||
|
||
private CheckApiKeyResponse( | ||
boolean valid, | ||
Optional<String> organizationId, | ||
Optional<String> ownerId, | ||
Map<String, Object> additionalProperties) { | ||
this.valid = valid; | ||
this.organizationId = organizationId; | ||
this.ownerId = ownerId; | ||
this.additionalProperties = additionalProperties; | ||
} | ||
|
||
@JsonProperty("valid") | ||
public boolean getValid() { | ||
return valid; | ||
} | ||
|
||
@JsonProperty("organization_id") | ||
public Optional<String> getOrganizationId() { | ||
return organizationId; | ||
} | ||
|
||
@JsonProperty("owner_id") | ||
public Optional<String> getOwnerId() { | ||
return ownerId; | ||
} | ||
|
||
@java.lang.Override | ||
public boolean equals(Object other) { | ||
if (this == other) return true; | ||
return other instanceof CheckApiKeyResponse && equalTo((CheckApiKeyResponse) other); | ||
} | ||
|
||
@JsonAnyGetter | ||
public Map<String, Object> getAdditionalProperties() { | ||
return this.additionalProperties; | ||
} | ||
|
||
private boolean equalTo(CheckApiKeyResponse other) { | ||
return valid == other.valid && organizationId.equals(other.organizationId) && ownerId.equals(other.ownerId); | ||
} | ||
|
||
@java.lang.Override | ||
public int hashCode() { | ||
return Objects.hash(this.valid, this.organizationId, this.ownerId); | ||
} | ||
|
||
@java.lang.Override | ||
public String toString() { | ||
return ObjectMappers.stringify(this); | ||
} | ||
|
||
public static ValidStage builder() { | ||
return new Builder(); | ||
} | ||
|
||
public interface ValidStage { | ||
_FinalStage valid(boolean valid); | ||
|
||
Builder from(CheckApiKeyResponse other); | ||
} | ||
|
||
public interface _FinalStage { | ||
CheckApiKeyResponse build(); | ||
|
||
_FinalStage organizationId(Optional<String> organizationId); | ||
|
||
_FinalStage organizationId(String organizationId); | ||
|
||
_FinalStage ownerId(Optional<String> ownerId); | ||
|
||
_FinalStage ownerId(String ownerId); | ||
} | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public static final class Builder implements ValidStage, _FinalStage { | ||
private boolean valid; | ||
|
||
private Optional<String> ownerId = Optional.empty(); | ||
|
||
private Optional<String> organizationId = Optional.empty(); | ||
|
||
@JsonAnySetter | ||
private Map<String, Object> additionalProperties = new HashMap<>(); | ||
|
||
private Builder() {} | ||
|
||
@java.lang.Override | ||
public Builder from(CheckApiKeyResponse other) { | ||
valid(other.getValid()); | ||
organizationId(other.getOrganizationId()); | ||
ownerId(other.getOwnerId()); | ||
return this; | ||
} | ||
|
||
@java.lang.Override | ||
@JsonSetter("valid") | ||
public _FinalStage valid(boolean valid) { | ||
this.valid = valid; | ||
return this; | ||
} | ||
|
||
@java.lang.Override | ||
public _FinalStage ownerId(String ownerId) { | ||
this.ownerId = Optional.of(ownerId); | ||
return this; | ||
} | ||
|
||
@java.lang.Override | ||
@JsonSetter(value = "owner_id", nulls = Nulls.SKIP) | ||
public _FinalStage ownerId(Optional<String> ownerId) { | ||
this.ownerId = ownerId; | ||
return this; | ||
} | ||
|
||
@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<String> organizationId) { | ||
this.organizationId = organizationId; | ||
return this; | ||
} | ||
|
||
@java.lang.Override | ||
public CheckApiKeyResponse build() { | ||
return new CheckApiKeyResponse(valid, organizationId, ownerId, additionalProperties); | ||
} | ||
} | ||
} |
Oops, something went wrong.