-
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
fe9906b
commit 99fe009
Showing
28 changed files
with
2,196 additions
and
430 deletions.
There are no files selected for viewing
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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.cohere.api.core; | ||
|
||
/** | ||
* This exception type will be thrown for any non-2XX API responses. | ||
*/ | ||
public class CohereApiApiError extends CohereApiError { | ||
/** | ||
* The error code of the response that triggered the exception. | ||
*/ | ||
private final int statusCode; | ||
|
||
/** | ||
* The body of the response that triggered the exception. | ||
*/ | ||
private final Object body; | ||
|
||
public CohereApiApiError(String message, int statusCode, Object body) { | ||
super(message); | ||
this.statusCode = statusCode; | ||
this.body = body; | ||
} | ||
|
||
/** | ||
* @return the statusCode | ||
*/ | ||
public int statusCode() { | ||
return this.statusCode; | ||
} | ||
|
||
/** | ||
* @return the body | ||
*/ | ||
public Object body() { | ||
return this.body; | ||
} | ||
|
||
@java.lang.Override | ||
public String toString() { | ||
return "CohereApiApiError{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + body | ||
+ "}"; | ||
} | ||
} |
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,17 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.cohere.api.core; | ||
|
||
/** | ||
* This class serves as the base exception for all errors in the SDK. | ||
*/ | ||
public class CohereApiError extends RuntimeException { | ||
public CohereApiError(String message) { | ||
super(message); | ||
} | ||
|
||
public CohereApiError(String message, Exception e) { | ||
super(message, e); | ||
} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
src/main/java/com/cohere/api/errors/CohereApiBadRequestError.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,26 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.cohere.api.errors; | ||
|
||
import com.cohere.api.core.CohereApiApiError; | ||
|
||
public final class CohereApiBadRequestError extends CohereApiApiError { | ||
/** | ||
* The body of the response that triggered the exception. | ||
*/ | ||
private final Object body; | ||
|
||
public CohereApiBadRequestError(Object body) { | ||
super("BadRequestError", 400, body); | ||
this.body = body; | ||
} | ||
|
||
/** | ||
* @return the body | ||
*/ | ||
@java.lang.Override | ||
public Object body() { | ||
return this.body; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/cohere/api/errors/CohereApiClientClosedRequestError.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,27 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.cohere.api.errors; | ||
|
||
import com.cohere.api.core.CohereApiApiError; | ||
import com.cohere.api.types.ClientClosedRequestErrorBody; | ||
|
||
public final class CohereApiClientClosedRequestError extends CohereApiApiError { | ||
/** | ||
* The body of the response that triggered the exception. | ||
*/ | ||
private final ClientClosedRequestErrorBody body; | ||
|
||
public CohereApiClientClosedRequestError(ClientClosedRequestErrorBody body) { | ||
super("ClientClosedRequestError", 499, body); | ||
this.body = body; | ||
} | ||
|
||
/** | ||
* @return the body | ||
*/ | ||
@java.lang.Override | ||
public ClientClosedRequestErrorBody body() { | ||
return this.body; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/cohere/api/errors/CohereApiForbiddenError.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,26 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.cohere.api.errors; | ||
|
||
import com.cohere.api.core.CohereApiApiError; | ||
|
||
public final class CohereApiForbiddenError extends CohereApiApiError { | ||
/** | ||
* The body of the response that triggered the exception. | ||
*/ | ||
private final Object body; | ||
|
||
public CohereApiForbiddenError(Object body) { | ||
super("ForbiddenError", 403, body); | ||
this.body = body; | ||
} | ||
|
||
/** | ||
* @return the body | ||
*/ | ||
@java.lang.Override | ||
public Object body() { | ||
return this.body; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/cohere/api/errors/CohereApiGatewayTimeoutError.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,27 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.cohere.api.errors; | ||
|
||
import com.cohere.api.core.CohereApiApiError; | ||
import com.cohere.api.types.GatewayTimeoutErrorBody; | ||
|
||
public final class CohereApiGatewayTimeoutError extends CohereApiApiError { | ||
/** | ||
* The body of the response that triggered the exception. | ||
*/ | ||
private final GatewayTimeoutErrorBody body; | ||
|
||
public CohereApiGatewayTimeoutError(GatewayTimeoutErrorBody body) { | ||
super("GatewayTimeoutError", 504, body); | ||
this.body = body; | ||
} | ||
|
||
/** | ||
* @return the body | ||
*/ | ||
@java.lang.Override | ||
public GatewayTimeoutErrorBody body() { | ||
return this.body; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/cohere/api/errors/CohereApiInternalServerError.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,26 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.cohere.api.errors; | ||
|
||
import com.cohere.api.core.CohereApiApiError; | ||
|
||
public final class CohereApiInternalServerError extends CohereApiApiError { | ||
/** | ||
* The body of the response that triggered the exception. | ||
*/ | ||
private final Object body; | ||
|
||
public CohereApiInternalServerError(Object body) { | ||
super("InternalServerError", 500, body); | ||
this.body = body; | ||
} | ||
|
||
/** | ||
* @return the body | ||
*/ | ||
@java.lang.Override | ||
public Object body() { | ||
return this.body; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/cohere/api/errors/CohereApiNotFoundError.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,26 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.cohere.api.errors; | ||
|
||
import com.cohere.api.core.CohereApiApiError; | ||
|
||
public final class CohereApiNotFoundError extends CohereApiApiError { | ||
/** | ||
* The body of the response that triggered the exception. | ||
*/ | ||
private final Object body; | ||
|
||
public CohereApiNotFoundError(Object body) { | ||
super("NotFoundError", 404, body); | ||
this.body = body; | ||
} | ||
|
||
/** | ||
* @return the body | ||
*/ | ||
@java.lang.Override | ||
public Object body() { | ||
return this.body; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/cohere/api/errors/CohereApiNotImplementedError.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,27 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.cohere.api.errors; | ||
|
||
import com.cohere.api.core.CohereApiApiError; | ||
import com.cohere.api.types.NotImplementedErrorBody; | ||
|
||
public final class CohereApiNotImplementedError extends CohereApiApiError { | ||
/** | ||
* The body of the response that triggered the exception. | ||
*/ | ||
private final NotImplementedErrorBody body; | ||
|
||
public CohereApiNotImplementedError(NotImplementedErrorBody body) { | ||
super("NotImplementedError", 501, body); | ||
this.body = body; | ||
} | ||
|
||
/** | ||
* @return the body | ||
*/ | ||
@java.lang.Override | ||
public NotImplementedErrorBody body() { | ||
return this.body; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/cohere/api/errors/CohereApiServiceUnavailableError.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,26 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.cohere.api.errors; | ||
|
||
import com.cohere.api.core.CohereApiApiError; | ||
|
||
public final class CohereApiServiceUnavailableError extends CohereApiApiError { | ||
/** | ||
* The body of the response that triggered the exception. | ||
*/ | ||
private final Object body; | ||
|
||
public CohereApiServiceUnavailableError(Object body) { | ||
super("ServiceUnavailableError", 503, body); | ||
this.body = body; | ||
} | ||
|
||
/** | ||
* @return the body | ||
*/ | ||
@java.lang.Override | ||
public Object body() { | ||
return this.body; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/cohere/api/errors/CohereApiTooManyRequestsError.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,27 @@ | ||
/** | ||
* This file was auto-generated by Fern from our API Definition. | ||
*/ | ||
package com.cohere.api.errors; | ||
|
||
import com.cohere.api.core.CohereApiApiError; | ||
import com.cohere.api.types.TooManyRequestsErrorBody; | ||
|
||
public final class CohereApiTooManyRequestsError extends CohereApiApiError { | ||
/** | ||
* The body of the response that triggered the exception. | ||
*/ | ||
private final TooManyRequestsErrorBody body; | ||
|
||
public CohereApiTooManyRequestsError(TooManyRequestsErrorBody body) { | ||
super("TooManyRequestsError", 429, body); | ||
this.body = body; | ||
} | ||
|
||
/** | ||
* @return the body | ||
*/ | ||
@java.lang.Override | ||
public TooManyRequestsErrorBody body() { | ||
return this.body; | ||
} | ||
} |
Oops, something went wrong.