getPackageVersionReadme method

Future<GetPackageVersionReadmeResult> getPackageVersionReadme({
  1. required String domain,
  2. required PackageFormat format,
  3. required String package,
  4. required String packageVersion,
  5. required String repository,
  6. String? domainOwner,
  7. String? namespace,
})

Gets the readme file or descriptive text for a package version.

The returned text might contain formatting. For example, it might contain formatting for Markdown or reStructuredText.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter domain : The name of the domain that contains the repository that contains the package version with the requested readme file.

Parameter format : A format that specifies the type of the package version with the requested readme file.

Parameter package : The name of the package version that contains the requested readme file.

Parameter packageVersion : A string that contains the package version (for example, 3.5.2).

Parameter repository : The repository that contains the package with the requested readme file.

Parameter domainOwner : The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.

Parameter namespace : The namespace of the package version with the requested readme file. The package component that specifies its namespace depends on its type. For example:

  • Maven
  • Swift
  • generic
  • The namespace of a Maven package version is its groupId.
  • The namespace of an npm or Swift package version is its scope.
  • The namespace of a generic package is its namespace.
  • Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.

Implementation

Future<GetPackageVersionReadmeResult> getPackageVersionReadme({
  required String domain,
  required PackageFormat format,
  required String package,
  required String packageVersion,
  required String repository,
  String? domainOwner,
  String? namespace,
}) async {
  final $query = <String, List<String>>{
    'domain': [domain],
    'format': [format.value],
    'package': [package],
    'version': [packageVersion],
    'repository': [repository],
    if (domainOwner != null) 'domain-owner': [domainOwner],
    if (namespace != null) 'namespace': [namespace],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/v1/package/version/readme',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetPackageVersionReadmeResult.fromJson(response);
}