Skip to content

Commit cdec589

Browse files
authored
feat(AWSKinesisVideoArchivedMedia): update models to latest (#4118)
1 parent b9e9d17 commit cdec589

9 files changed

+576
-9
lines changed

AWSKinesisVideoArchivedMedia/AWSKinesisVideoArchivedMedia.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright 2010-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// Copyright 2010-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License").
55
// You may not use this file except in compliance with the License.

AWSKinesisVideoArchivedMedia/AWSKinesisVideoArchivedMediaModel.h

Lines changed: 136 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright 2010-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// Copyright 2010-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License").
55
// You may not use this file except in compliance with the License.
@@ -71,6 +71,17 @@ typedef NS_ENUM(NSInteger, AWSKinesisVideoArchivedMediaDASHPlaybackMode) {
7171
AWSKinesisVideoArchivedMediaDASHPlaybackModeOnDemand,
7272
};
7373

74+
typedef NS_ENUM(NSInteger, AWSKinesisVideoArchivedMediaFormat) {
75+
AWSKinesisVideoArchivedMediaFormatUnknown,
76+
AWSKinesisVideoArchivedMediaFormatJpeg,
77+
AWSKinesisVideoArchivedMediaFormatPng,
78+
};
79+
80+
typedef NS_ENUM(NSInteger, AWSKinesisVideoArchivedMediaFormatConfigKey) {
81+
AWSKinesisVideoArchivedMediaFormatConfigKeyUnknown,
82+
AWSKinesisVideoArchivedMediaFormatConfigKeyJPEGQuality,
83+
};
84+
7485
typedef NS_ENUM(NSInteger, AWSKinesisVideoArchivedMediaFragmentSelectorType) {
7586
AWSKinesisVideoArchivedMediaFragmentSelectorTypeUnknown,
7687
AWSKinesisVideoArchivedMediaFragmentSelectorTypeProducerTimestamp,
@@ -103,6 +114,18 @@ typedef NS_ENUM(NSInteger, AWSKinesisVideoArchivedMediaHLSPlaybackMode) {
103114
AWSKinesisVideoArchivedMediaHLSPlaybackModeOnDemand,
104115
};
105116

117+
typedef NS_ENUM(NSInteger, AWSKinesisVideoArchivedMediaImageError) {
118+
AWSKinesisVideoArchivedMediaImageErrorUnknown,
119+
AWSKinesisVideoArchivedMediaImageErrorNoMedia,
120+
AWSKinesisVideoArchivedMediaImageErrorMediaError,
121+
};
122+
123+
typedef NS_ENUM(NSInteger, AWSKinesisVideoArchivedMediaImageSelectorType) {
124+
AWSKinesisVideoArchivedMediaImageSelectorTypeUnknown,
125+
AWSKinesisVideoArchivedMediaImageSelectorTypeProducerTimestamp,
126+
AWSKinesisVideoArchivedMediaImageSelectorTypeServerTimestamp,
127+
};
128+
106129
@class AWSKinesisVideoArchivedMediaClipFragmentSelector;
107130
@class AWSKinesisVideoArchivedMediaClipTimestampRange;
108131
@class AWSKinesisVideoArchivedMediaDASHFragmentSelector;
@@ -115,10 +138,13 @@ typedef NS_ENUM(NSInteger, AWSKinesisVideoArchivedMediaHLSPlaybackMode) {
115138
@class AWSKinesisVideoArchivedMediaGetDASHStreamingSessionURLOutput;
116139
@class AWSKinesisVideoArchivedMediaGetHLSStreamingSessionURLInput;
117140
@class AWSKinesisVideoArchivedMediaGetHLSStreamingSessionURLOutput;
141+
@class AWSKinesisVideoArchivedMediaGetImagesInput;
142+
@class AWSKinesisVideoArchivedMediaGetImagesOutput;
118143
@class AWSKinesisVideoArchivedMediaGetMediaForFragmentListInput;
119144
@class AWSKinesisVideoArchivedMediaGetMediaForFragmentListOutput;
120145
@class AWSKinesisVideoArchivedMediaHLSFragmentSelector;
121146
@class AWSKinesisVideoArchivedMediaHLSTimestampRange;
147+
@class AWSKinesisVideoArchivedMediaImage;
122148
@class AWSKinesisVideoArchivedMediaListFragmentsInput;
123149
@class AWSKinesisVideoArchivedMediaListFragmentsOutput;
124150
@class AWSKinesisVideoArchivedMediaTimestampRange;
@@ -417,6 +443,92 @@ typedef NS_ENUM(NSInteger, AWSKinesisVideoArchivedMediaHLSPlaybackMode) {
417443

418444
@end
419445

446+
/**
447+
448+
*/
449+
@interface AWSKinesisVideoArchivedMediaGetImagesInput : AWSRequest
450+
451+
452+
/**
453+
<p>The end timestamp for the range of images to be generated.</p>
454+
*/
455+
@property (nonatomic, strong) NSDate * _Nullable endTimestamp;
456+
457+
/**
458+
<p>The format that will be used to encode the image.</p>
459+
*/
460+
@property (nonatomic, assign) AWSKinesisVideoArchivedMediaFormat format;
461+
462+
/**
463+
<p>The list of a key-value pair structure that contains extra parameters that can be applied when the image is generated. The <code>FormatConfig</code> key is the <code>JPEGQuality</code>, which indicates the JPEG quality key to be used to generate the image. The <code>FormatConfig</code> value accepts ints from 1 to 100. If the value is 1, the image will be generated with less quality and the best compression. If the value is 100, the image will be generated with the best quality and less compression. If no value is provided, the default value of the <code>JPEGQuality</code> key will be set to 80.</p>
464+
*/
465+
@property (nonatomic, strong) NSDictionary<NSString *, NSString *> * _Nullable formatConfig;
466+
467+
/**
468+
<p>The height of the output image that is used in conjunction with the <code>WidthPixels</code> parameter. When both <code>HeightPixels</code> and <code>WidthPixels</code> parameters are provided, the image will be stretched to fit the specified aspect ratio. If only the <code>HeightPixels</code> parameter is provided, its original aspect ratio will be used to calculate the <code>WidthPixels</code> ratio. If neither parameter is provided, the original image size will be returned.</p>
469+
*/
470+
@property (nonatomic, strong) NSNumber * _Nullable heightPixels;
471+
472+
/**
473+
<p>The origin of the Server or Producer timestamps to use to generate the images.</p>
474+
*/
475+
@property (nonatomic, assign) AWSKinesisVideoArchivedMediaImageSelectorType imageSelectorType;
476+
477+
/**
478+
<p>The maximum number of images to be returned by the API. </p><note><p>The default limit is 100 images per API response. The additional results will be paginated. </p></note>
479+
*/
480+
@property (nonatomic, strong) NSNumber * _Nullable maxResults;
481+
482+
/**
483+
<p>A token that specifies where to start paginating the next set of Images. This is the <code>GetImages:NextToken</code> from a previously truncated response.</p>
484+
*/
485+
@property (nonatomic, strong) NSString * _Nullable nextToken;
486+
487+
/**
488+
<p>The time interval in milliseconds (ms) at which the images need to be generated from the stream. The minimum value that can be provided is 3000 ms. If the timestamp range is less than the sampling interval, the Image from the <code>startTimestamp</code> will be returned if available. </p><note><p>The minimum value of 3000 ms is a soft limit. If needed, a lower sampling frequency can be requested.</p></note>
489+
*/
490+
@property (nonatomic, strong) NSNumber * _Nullable samplingInterval;
491+
492+
/**
493+
<p>The starting point from which the images should be generated. This <code>StartTimestamp</code> must be within an inclusive range of timestamps for an image to be returned.</p>
494+
*/
495+
@property (nonatomic, strong) NSDate * _Nullable startTimestamp;
496+
497+
/**
498+
<p>The Amazon Resource Name (ARN) of the stream from which to retrieve the images. You must specify either the <code>StreamName</code> or the <code>StreamARN</code>.</p>
499+
*/
500+
@property (nonatomic, strong) NSString * _Nullable streamARN;
501+
502+
/**
503+
<p>The name of the stream from which to retrieve the images. You must specify either the <code>StreamName</code> or the <code>StreamARN</code>.</p>
504+
*/
505+
@property (nonatomic, strong) NSString * _Nullable streamName;
506+
507+
/**
508+
<p>The width of the output image that is used in conjunction with the <code>HeightPixels</code> parameter. When both <code>WidthPixels</code> and <code>HeightPixels</code> parameters are provided, the image will be stretched to fit the specified aspect ratio. If only the <code>WidthPixels</code> parameter is provided or if only the <code>HeightPixels</code> is provided, a <code>ValidationException</code> will be thrown. If neither parameter is provided, the original image size from the stream will be returned.</p>
509+
*/
510+
@property (nonatomic, strong) NSNumber * _Nullable widthPixels;
511+
512+
@end
513+
514+
/**
515+
516+
*/
517+
@interface AWSKinesisVideoArchivedMediaGetImagesOutput : AWSModel
518+
519+
520+
/**
521+
<p>The list of images generated from the video stream. If there is no media available for the given timestamp, the <code>NO_MEDIA</code> error will be listed in the output. If an error occurs while the image is being generated, the <code>MEDIA_ERROR</code> will be listed in the output as the cause of the missing image. </p>
522+
*/
523+
@property (nonatomic, strong) NSArray<AWSKinesisVideoArchivedMediaImage *> * _Nullable images;
524+
525+
/**
526+
<p>The encrypted token that was used in the request to get more images.</p>
527+
*/
528+
@property (nonatomic, strong) NSString * _Nullable nextToken;
529+
530+
@end
531+
420532
/**
421533
422534
*/
@@ -494,6 +606,29 @@ typedef NS_ENUM(NSInteger, AWSKinesisVideoArchivedMediaHLSPlaybackMode) {
494606

495607
@end
496608

609+
/**
610+
<p>A structure that contains the <code>Timestamp</code>, <code>Error</code>, and <code>ImageContent</code>.</p>
611+
*/
612+
@interface AWSKinesisVideoArchivedMediaImage : AWSModel
613+
614+
615+
/**
616+
<p>The error message shown when the image for the provided timestamp was not extracted due to a non-tryable error. An error will be returned if: </p><ul><li><p>There is no media that exists for the specified <code>Timestamp</code>.</p></li></ul><ul><li><p>The media for the specified time does not allow an image to be extracted. In this case the media is audio only, or the incorrect media has been ingested.</p></li></ul>
617+
*/
618+
@property (nonatomic, assign) AWSKinesisVideoArchivedMediaImageError error;
619+
620+
/**
621+
<p>An attribute of the <code>Image</code> object that is Base64 encoded.</p>
622+
*/
623+
@property (nonatomic, strong) NSString * _Nullable imageContent;
624+
625+
/**
626+
<p>An attribute of the <code>Image</code> object that is used to extract an image from the video stream. This field is used to manage gaps on images or to better understand the pagination window.</p>
627+
*/
628+
@property (nonatomic, strong) NSDate * _Nullable timeStamp;
629+
630+
@end
631+
497632
/**
498633
499634
*/

AWSKinesisVideoArchivedMedia/AWSKinesisVideoArchivedMediaModel.m

Lines changed: 148 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright 2010-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// Copyright 2010-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License").
55
// You may not use this file except in compliance with the License.
@@ -510,6 +510,108 @@ + (NSDictionary *)JSONKeyPathsByPropertyKey {
510510

511511
@end
512512

513+
@implementation AWSKinesisVideoArchivedMediaGetImagesInput
514+
515+
+ (BOOL)supportsSecureCoding {
516+
return YES;
517+
}
518+
519+
+ (NSDictionary *)JSONKeyPathsByPropertyKey {
520+
return @{
521+
@"endTimestamp" : @"EndTimestamp",
522+
@"format" : @"Format",
523+
@"formatConfig" : @"FormatConfig",
524+
@"heightPixels" : @"HeightPixels",
525+
@"imageSelectorType" : @"ImageSelectorType",
526+
@"maxResults" : @"MaxResults",
527+
@"nextToken" : @"NextToken",
528+
@"samplingInterval" : @"SamplingInterval",
529+
@"startTimestamp" : @"StartTimestamp",
530+
@"streamARN" : @"StreamARN",
531+
@"streamName" : @"StreamName",
532+
@"widthPixels" : @"WidthPixels",
533+
};
534+
}
535+
536+
+ (NSValueTransformer *)endTimestampJSONTransformer {
537+
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSNumber *number) {
538+
return [NSDate dateWithTimeIntervalSince1970:[number doubleValue]];
539+
} reverseBlock:^id(NSDate *date) {
540+
return [NSString stringWithFormat:@"%f", [date timeIntervalSince1970]];
541+
}];
542+
}
543+
544+
+ (NSValueTransformer *)formatJSONTransformer {
545+
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^NSNumber *(NSString *value) {
546+
if ([value caseInsensitiveCompare:@"JPEG"] == NSOrderedSame) {
547+
return @(AWSKinesisVideoArchivedMediaFormatJpeg);
548+
}
549+
if ([value caseInsensitiveCompare:@"PNG"] == NSOrderedSame) {
550+
return @(AWSKinesisVideoArchivedMediaFormatPng);
551+
}
552+
return @(AWSKinesisVideoArchivedMediaFormatUnknown);
553+
} reverseBlock:^NSString *(NSNumber *value) {
554+
switch ([value integerValue]) {
555+
case AWSKinesisVideoArchivedMediaFormatJpeg:
556+
return @"JPEG";
557+
case AWSKinesisVideoArchivedMediaFormatPng:
558+
return @"PNG";
559+
default:
560+
return nil;
561+
}
562+
}];
563+
}
564+
565+
+ (NSValueTransformer *)imageSelectorTypeJSONTransformer {
566+
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^NSNumber *(NSString *value) {
567+
if ([value caseInsensitiveCompare:@"PRODUCER_TIMESTAMP"] == NSOrderedSame) {
568+
return @(AWSKinesisVideoArchivedMediaImageSelectorTypeProducerTimestamp);
569+
}
570+
if ([value caseInsensitiveCompare:@"SERVER_TIMESTAMP"] == NSOrderedSame) {
571+
return @(AWSKinesisVideoArchivedMediaImageSelectorTypeServerTimestamp);
572+
}
573+
return @(AWSKinesisVideoArchivedMediaImageSelectorTypeUnknown);
574+
} reverseBlock:^NSString *(NSNumber *value) {
575+
switch ([value integerValue]) {
576+
case AWSKinesisVideoArchivedMediaImageSelectorTypeProducerTimestamp:
577+
return @"PRODUCER_TIMESTAMP";
578+
case AWSKinesisVideoArchivedMediaImageSelectorTypeServerTimestamp:
579+
return @"SERVER_TIMESTAMP";
580+
default:
581+
return nil;
582+
}
583+
}];
584+
}
585+
586+
+ (NSValueTransformer *)startTimestampJSONTransformer {
587+
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSNumber *number) {
588+
return [NSDate dateWithTimeIntervalSince1970:[number doubleValue]];
589+
} reverseBlock:^id(NSDate *date) {
590+
return [NSString stringWithFormat:@"%f", [date timeIntervalSince1970]];
591+
}];
592+
}
593+
594+
@end
595+
596+
@implementation AWSKinesisVideoArchivedMediaGetImagesOutput
597+
598+
+ (BOOL)supportsSecureCoding {
599+
return YES;
600+
}
601+
602+
+ (NSDictionary *)JSONKeyPathsByPropertyKey {
603+
return @{
604+
@"images" : @"Images",
605+
@"nextToken" : @"NextToken",
606+
};
607+
}
608+
609+
+ (NSValueTransformer *)imagesJSONTransformer {
610+
return [NSValueTransformer awsmtl_JSONArrayTransformerWithModelClass:[AWSKinesisVideoArchivedMediaImage class]];
611+
}
612+
613+
@end
614+
513615
@implementation AWSKinesisVideoArchivedMediaGetMediaForFragmentListInput
514616

515617
+ (BOOL)supportsSecureCoding {
@@ -612,6 +714,51 @@ + (NSValueTransformer *)startTimestampJSONTransformer {
612714

613715
@end
614716

717+
@implementation AWSKinesisVideoArchivedMediaImage
718+
719+
+ (BOOL)supportsSecureCoding {
720+
return YES;
721+
}
722+
723+
+ (NSDictionary *)JSONKeyPathsByPropertyKey {
724+
return @{
725+
@"error" : @"Error",
726+
@"imageContent" : @"ImageContent",
727+
@"timeStamp" : @"TimeStamp",
728+
};
729+
}
730+
731+
+ (NSValueTransformer *)errorJSONTransformer {
732+
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^NSNumber *(NSString *value) {
733+
if ([value caseInsensitiveCompare:@"NO_MEDIA"] == NSOrderedSame) {
734+
return @(AWSKinesisVideoArchivedMediaImageErrorNoMedia);
735+
}
736+
if ([value caseInsensitiveCompare:@"MEDIA_ERROR"] == NSOrderedSame) {
737+
return @(AWSKinesisVideoArchivedMediaImageErrorMediaError);
738+
}
739+
return @(AWSKinesisVideoArchivedMediaImageErrorUnknown);
740+
} reverseBlock:^NSString *(NSNumber *value) {
741+
switch ([value integerValue]) {
742+
case AWSKinesisVideoArchivedMediaImageErrorNoMedia:
743+
return @"NO_MEDIA";
744+
case AWSKinesisVideoArchivedMediaImageErrorMediaError:
745+
return @"MEDIA_ERROR";
746+
default:
747+
return nil;
748+
}
749+
}];
750+
}
751+
752+
+ (NSValueTransformer *)timeStampJSONTransformer {
753+
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSNumber *number) {
754+
return [NSDate dateWithTimeIntervalSince1970:[number doubleValue]];
755+
} reverseBlock:^id(NSDate *date) {
756+
return [NSString stringWithFormat:@"%f", [date timeIntervalSince1970]];
757+
}];
758+
}
759+
760+
@end
761+
615762
@implementation AWSKinesisVideoArchivedMediaListFragmentsInput
616763

617764
+ (BOOL)supportsSecureCoding {

AWSKinesisVideoArchivedMedia/AWSKinesisVideoArchivedMediaResources.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright 2010-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// Copyright 2010-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License").
55
// You may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)