updateWorkspaceConfiguration method

Future<UpdateWorkspaceConfigurationResponse> updateWorkspaceConfiguration({
  1. required String workspaceId,
  2. String? clientToken,
  3. List<LimitsPerLabelSet>? limitsPerLabelSet,
  4. int? retentionPeriodInDays,
})

Use this operation to create or update the label sets, label set limits, and retention period of a workspace.

You must specify at least one of limitsPerLabelSet or retentionPeriodInDays for the request to be valid.

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

Parameter workspaceId : The ID of the workspace that you want to update. To find the IDs of your workspaces, use the ListWorkspaces operation.

Parameter clientToken : You can include a token in your operation to make it an idempotent opeartion.

Parameter limitsPerLabelSet : This is an array of structures, where each structure defines a label set for the workspace, and defines the active time series limit for each of those label sets. Each label name in a label set must be unique.

Parameter retentionPeriodInDays : Specifies how many days that metrics will be retained in the workspace.

Implementation

Future<UpdateWorkspaceConfigurationResponse> updateWorkspaceConfiguration({
  required String workspaceId,
  String? clientToken,
  List<LimitsPerLabelSet>? limitsPerLabelSet,
  int? retentionPeriodInDays,
}) async {
  final $payload = <String, dynamic>{
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (limitsPerLabelSet != null) 'limitsPerLabelSet': limitsPerLabelSet,
    if (retentionPeriodInDays != null)
      'retentionPeriodInDays': retentionPeriodInDays,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/workspaces/${Uri.encodeComponent(workspaceId)}/configuration',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateWorkspaceConfigurationResponse.fromJson(response);
}