updateMesh method

Future<UpdateMeshOutput> updateMesh({
  1. required String meshName,
  2. String? clientToken,
  3. MeshSpec? spec,
})

Updates an existing service mesh.

May throw NotFoundException. May throw BadRequestException. May throw ConflictException. May throw TooManyRequestsException. May throw ForbiddenException. May throw ServiceUnavailableException. May throw InternalServerErrorException.

Parameter meshName : The name of the service mesh to update.

Parameter clientToken : Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.

Parameter spec : The service mesh specification to apply.

Implementation

Future<UpdateMeshOutput> updateMesh({
  required String meshName,
  String? clientToken,
  MeshSpec? spec,
}) async {
  ArgumentError.checkNotNull(meshName, 'meshName');
  _s.validateStringLength(
    'meshName',
    meshName,
    1,
    255,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (spec != null) 'spec': spec,
  };
  final response = await _protocol.sendRaw(
    payload: $payload,
    method: 'PUT',
    requestUri: '/v20190125/meshes/${Uri.encodeComponent(meshName)}',
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return UpdateMeshOutput(
    mesh: MeshData.fromJson($json),
  );
}