use of com.amazonaws.services.kinesisvideo.model.DeleteStreamRequest in project aws-sdk-android by aws-amplify.
the class KinesisVideoAndroidServiceClient method deleteStream.
@Override
public void deleteStream(@NonNull final String streamName, @NonNull final String version, final Date creationTime, long timeoutInMillis, @Nullable final KinesisVideoCredentialsProvider credentialsProvider) throws KinesisVideoException {
final AWSKinesisVideoClient serviceClient = createAwsKinesisVideoClient(credentialsProvider, Region.getRegion(Regions.fromName(configuration.getRegion())), configuration.getEndpoint(), (int) timeoutInMillis);
final StreamDescription streamDescription = describeStream(streamName, timeoutInMillis, credentialsProvider);
final DeleteStreamRequest deleteStreamRequest = new DeleteStreamRequest().withStreamARN(streamDescription.getStreamArn()).withCurrentVersion(streamDescription.getUpdateVersion());
log.debug("calling delete stream: " + deleteStreamRequest.toString());
final DeleteStreamResult deleteStreamResult;
try {
deleteStreamResult = serviceClient.deleteStream(deleteStreamRequest);
} catch (final AmazonClientException e) {
log.exception(e, "Service call failed.");
throw new KinesisVideoException(e);
}
log.debug("delete stream result: " + deleteStreamResult.toString());
}
Aggregations