getSolNetworkPackageContent method
Future<GetSolNetworkPackageContentOutput>
getSolNetworkPackageContent({
- required PackageContentType accept,
- required String nsdInfoId,
Gets the contents of a network package.
A network package is a .zip file in CSAR (Cloud Service Archive) format defines the function packages you want to deploy and the Amazon Web Services infrastructure you want to deploy them on.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter accept :
The format of the package you want to download from the network package.
Parameter nsdInfoId :
ID of the network service descriptor in the network package.
Implementation
Future<GetSolNetworkPackageContentOutput> getSolNetworkPackageContent({
required PackageContentType accept,
required String nsdInfoId,
}) async {
final headers = <String, String>{
'Accept': accept.value,
};
final response = await _protocol.sendRaw(
payload: null,
method: 'GET',
requestUri:
'/sol/nsd/v1/ns_descriptors/${Uri.encodeComponent(nsdInfoId)}/nsd_content',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return GetSolNetworkPackageContentOutput(
nsdContent: await response.stream.toBytes(),
contentType: _s
.extractHeaderStringValue(response.headers, 'Content-Type')
?.let(PackageContentType.fromString),
);
}