associateFeed method
Associates a resource with the feed. The resource provides the input that Elemental Inference needs in order to perform an Elemental Inference feature, such as cropping video. You always provide the resource by associating it with a feed. You can associate only one resource with each feed. With an association, a specific source media is claiming ownership of the feed.
AssociateFeed is a PATCH operation, which means that you can include only parameters that you want to change. Parameters that you don't include will not be affected by the operation.
Specifically:
- You can add more outputs to the existing outputs. New outputs will be appended.
- You can't modify an existing output (for example to change its name). Instead, use UpdateFeed.
- You can't delete an existing output. Instead, use UpdateFeed.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerErrorException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw TooManyRequestException.
May throw ValidationException.
Parameter id :
The ID of the feed.
Parameter outputs :
An array of one or more outputs that you want to add to this feed now, to
supplement any outputs that you specified when you created or updated the
feed.
Parameter associatedResourceName :
An identifier for the resource. This name must not resemble an ARN.
The resource is the source media that the feed will process. The name you assign should help you to later identify the source media that belongs to the feed. In this way, you will know which source media to push to the feed (using PutMedia).
Parameter dryRun :
Set to true if you want to do a dry run of the associate action.
Elemental Inference will validate that the real request would succeed without actually making any changes. A dry run catches errors such as missing IAM permissions, quota limits exceeded, conflicting outputs, and so on. If the dry run fails, the action returns a 4xx error code. After you've fixed the errors, resubmit the request.
Implementation
Future<AssociateFeedResponse> associateFeed({
required String id,
required List<CreateOutput> outputs,
String? associatedResourceName,
bool? dryRun,
}) async {
final $payload = <String, dynamic>{
'outputs': outputs,
'associatedResourceName':
associatedResourceName ?? _s.generateIdempotencyToken(),
if (dryRun != null) 'dryRun': dryRun,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v1/feed/${Uri.encodeComponent(id)}/associate',
exceptionFnMap: _exceptionFns,
);
return AssociateFeedResponse.fromJson(response);
}