getSdk method
Generates a client SDK for a RestApi and Stage.
May throw BadRequestException.
May throw ConflictException.
May throw LimitExceededException.
May throw NotFoundException.
May throw TooManyRequestsException.
May throw UnauthorizedException.
Parameter restApiId :
The string identifier of the associated RestApi.
Parameter sdkType :
The language for the generated SDK. Currently java,
javascript, android, objectivec
(for iOS), swift (for iOS), and ruby are
supported.
Parameter stageName :
The name of the Stage that the SDK will use.
Parameter parameters :
A string-to-string key-value map of query parameters
sdkType-dependent properties of the SDK. For
sdkType of objectivec or swift, a
parameter named classPrefix is required. For
sdkType of android, parameters named
groupId, artifactId,
artifactVersion, and invokerPackage are
required. For sdkType of java, parameters named
serviceName and javaPackageName are required.
Implementation
Future<SdkResponse> getSdk({
required String restApiId,
required String sdkType,
required String stageName,
Map<String, String>? parameters,
}) async {
final response = await _protocol.sendRaw(
payload: null,
method: 'GET',
requestUri:
'/restapis/${Uri.encodeComponent(restApiId)}/stages/${Uri.encodeComponent(stageName)}/sdks/${Uri.encodeComponent(sdkType)}',
exceptionFnMap: _exceptionFns,
);
return SdkResponse(
body: await response.stream.toBytes(),
contentDisposition:
_s.extractHeaderStringValue(response.headers, 'Content-Disposition'),
contentType:
_s.extractHeaderStringValue(response.headers, 'Content-Type'),
);
}