createHoursOfOperation method
Creates hours of operation.
May throw DuplicateResourceException.
May throw InternalServiceException.
May throw InvalidParameterException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
Parameter config :
Configuration information for the hours of operation: day, start time, and
end time.
Parameter instanceId :
The identifier of the Connect Customer instance. You can find
the instance ID in the Amazon Resource Name (ARN) of the instance.
Parameter name :
The name of the hours of operation.
Parameter timeZone :
The time zone of the hours of operation.
Parameter description :
The description of the hours of operation.
Parameter parentHoursOfOperationConfigs :
Configuration for parent hours of operations. Eg: ResourceArn.
For more information about parent hours of operations, see Link overrides from different hours of operation in the Administrator Guide.
Parameter tags :
The tags used to organize, track, or control access for this resource. For
example, { "Tags": {"key1":"value1", "key2":"value2"} }.
Implementation
Future<CreateHoursOfOperationResponse> createHoursOfOperation({
required List<HoursOfOperationConfig> config,
required String instanceId,
required String name,
required String timeZone,
String? description,
List<ParentHoursOfOperationConfig>? parentHoursOfOperationConfigs,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'Config': config,
'Name': name,
'TimeZone': timeZone,
if (description != null) 'Description': description,
if (parentHoursOfOperationConfigs != null)
'ParentHoursOfOperationConfigs': parentHoursOfOperationConfigs,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/hours-of-operations/${Uri.encodeComponent(instanceId)}',
exceptionFnMap: _exceptionFns,
);
return CreateHoursOfOperationResponse.fromJson(response);
}