createStage method
- required String deploymentId,
- required String restApiId,
- required String stageName,
- bool? cacheClusterEnabled,
- CacheClusterSize? cacheClusterSize,
- CanarySettings? canarySettings,
- String? description,
- String? documentationVersion,
- Map<String, String> ? tags,
- bool? tracingEnabled,
- Map<String, String> ? variables,
Creates a new Stage resource that references a pre-existing Deployment for the API.
May throw UnauthorizedException. May throw BadRequestException. May throw NotFoundException. May throw ConflictException. May throw LimitExceededException. May throw TooManyRequestsException.
Parameter deploymentId :
Required The identifier of the Deployment resource for the
Stage resource.
Parameter restApiId :
Required The string identifier of the associated RestApi.
Parameter stageName :
Required The name for the Stage resource. Stage names can only
contain alphanumeric characters, hyphens, and underscores. Maximum length
is 128 characters.
Parameter cacheClusterEnabled :
Whether cache clustering is enabled for the stage.
Parameter cacheClusterSize :
The stage's cache cluster size.
Parameter canarySettings :
The canary deployment settings of this stage.
Parameter description :
The description of the Stage resource.
Parameter documentationVersion :
The version of the associated API documentation.
Parameter tags :
The key-value map of strings. The valid character set is a-zA-Z+-=._:/.
The tag key can be up to 128 characters and must not start with
aws:. The tag value can be up to 256 characters.
Parameter tracingEnabled :
Specifies whether active tracing with X-ray is enabled for the
Stage.
Parameter variables :
A map that defines the stage variables for the new Stage resource.
Variable names can have alphanumeric and underscore characters, and the
values must match A-Za-z0-9-._~:/?#&=,+
Implementation
Future<Stage> createStage({
  required String deploymentId,
  required String restApiId,
  required String stageName,
  bool? cacheClusterEnabled,
  CacheClusterSize? cacheClusterSize,
  CanarySettings? canarySettings,
  String? description,
  String? documentationVersion,
  Map<String, String>? tags,
  bool? tracingEnabled,
  Map<String, String>? variables,
}) async {
  ArgumentError.checkNotNull(deploymentId, 'deploymentId');
  ArgumentError.checkNotNull(restApiId, 'restApiId');
  ArgumentError.checkNotNull(stageName, 'stageName');
  final $payload = <String, dynamic>{
    'deploymentId': deploymentId,
    'stageName': stageName,
    if (cacheClusterEnabled != null)
      'cacheClusterEnabled': cacheClusterEnabled,
    if (cacheClusterSize != null)
      'cacheClusterSize': cacheClusterSize.toValue(),
    if (canarySettings != null) 'canarySettings': canarySettings,
    if (description != null) 'description': description,
    if (documentationVersion != null)
      'documentationVersion': documentationVersion,
    if (tags != null) 'tags': tags,
    if (tracingEnabled != null) 'tracingEnabled': tracingEnabled,
    if (variables != null) 'variables': variables,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/restapis/${Uri.encodeComponent(restApiId)}/stages',
    exceptionFnMap: _exceptionFns,
  );
  return Stage.fromJson(response);
}