public final class GeneralApi<ParamT extends HalfDuplexParamBase> extends Object
| 构造器和说明 |
|---|
GeneralApi()
Create default http client.
|
GeneralApi(ConnectionOptions connectionOptions)
Create custom http client
|
| 限定符和类型 | 方法和说明 |
|---|---|
DashScopeResult |
call(ParamT param,
ServiceOption serviceOptions)
Call the server to get the whole result.
|
void |
call(ParamT param,
ServiceOption serviceOptions,
ResultCallback<DashScopeResult> callback)
Call the server to get the result in the callback function.
|
DashScopeResult |
delete(HalfDuplexParamBase param,
ServiceOption serviceOption)
Make a Delete request.
|
DashScopeResult |
get(HalfDuplexParamBase param,
ServiceOption serviceOption)
Make a get request.
|
io.reactivex.Flowable<DashScopeResult> |
streamCall(ParamT param,
ServiceOption serviceOptions)
Call the server to get the result by stream.
|
void |
streamCall(ParamT param,
ServiceOption serviceOptions,
ResultCallback<DashScopeResult> callback)
Call the server to get the result by stream.
|
public GeneralApi()
public GeneralApi(ConnectionOptions connectionOptions)
connectionOptions - The client option.public DashScopeResult call(ParamT param, ServiceOption serviceOptions) throws ApiException, NoApiKeyException
param - The input param, should be the subclass of `Param`.serviceOptions - The service option.NoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public void call(ParamT param, ServiceOption serviceOptions, ResultCallback<DashScopeResult> callback) throws ApiException, NoApiKeyException
param - The input param, should be the subclass of `Param`.serviceOptions - The service optionscallback - The callback to receive response, should be the subclass of `Result`.NoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public io.reactivex.Flowable<DashScopeResult> streamCall(ParamT param, ServiceOption serviceOptions) throws ApiException, NoApiKeyException
param - The input param, should be the subclass of `Param`.serviceOptions - The service optionsNoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public void streamCall(ParamT param, ServiceOption serviceOptions, ResultCallback<DashScopeResult> callback) throws ApiException, NoApiKeyException
param - The input param, should be the subclass of `Param`.serviceOptions - The service optionscallback - The result callback.NoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public DashScopeResult get(HalfDuplexParamBase param, ServiceOption serviceOption) throws ApiException, NoApiKeyException
param - The paramserviceOption - The service optionsNoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public DashScopeResult delete(HalfDuplexParamBase param, ServiceOption serviceOption) throws ApiException, NoApiKeyException
param - The param.serviceOption - The service optionsNoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.Copyright © 2024. All rights reserved.