Skip to content

Commit

Permalink
feat(AWSDynamoDB): update models to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
awsmobilesdk committed Oct 18, 2023
1 parent a2bf4fa commit 5b60fa8
Show file tree
Hide file tree
Showing 5 changed files with 255 additions and 6 deletions.
63 changes: 62 additions & 1 deletion AWSDynamoDB/AWSDynamoDBModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,18 @@ typedef NS_ENUM(NSInteger, AWSDynamoDBExportStatus) {
AWSDynamoDBExportStatusFailed,
};

typedef NS_ENUM(NSInteger, AWSDynamoDBExportType) {
AWSDynamoDBExportTypeUnknown,
AWSDynamoDBExportTypeFullExport,
AWSDynamoDBExportTypeIncrementalExport,
};

typedef NS_ENUM(NSInteger, AWSDynamoDBExportViewType) {
AWSDynamoDBExportViewTypeUnknown,
AWSDynamoDBExportViewTypeNewImage,
AWSDynamoDBExportViewTypeNewAndOldImages,
};

typedef NS_ENUM(NSInteger, AWSDynamoDBGlobalTableStatus) {
AWSDynamoDBGlobalTableStatusUnknown,
AWSDynamoDBGlobalTableStatusCreating,
Expand Down Expand Up @@ -441,6 +453,7 @@ typedef NS_ENUM(NSInteger, AWSDynamoDBTimeToLiveStatus) {
@class AWSDynamoDBImportTableDescription;
@class AWSDynamoDBImportTableInput;
@class AWSDynamoDBImportTableOutput;
@class AWSDynamoDBIncrementalExportSpecification;
@class AWSDynamoDBInputFormatOptions;
@class AWSDynamoDBItemCollectionMetrics;
@class AWSDynamoDBItemResponse;
Expand Down Expand Up @@ -2416,6 +2429,11 @@ typedef NS_ENUM(NSInteger, AWSDynamoDBTimeToLiveStatus) {
*/
@property (nonatomic, strong) NSDate * _Nullable exportTime;

/**
<p>The type of export that was performed. Valid values are <code>FULL_EXPORT</code> or <code>INCREMENTAL_EXPORT</code>.</p>
*/
@property (nonatomic, assign) AWSDynamoDBExportType exportType;

/**
<p>Status code for the result of the failed export.</p>
*/
Expand All @@ -2426,6 +2444,11 @@ typedef NS_ENUM(NSInteger, AWSDynamoDBTimeToLiveStatus) {
*/
@property (nonatomic, strong) NSString * _Nullable failureMessage;

/**
<p>Optional object containing the parameters specific to an incremental export.</p>
*/
@property (nonatomic, strong) AWSDynamoDBIncrementalExportSpecification * _Nullable incrementalExportSpecification;

/**
<p>The number of items exported.</p>
*/
Expand Down Expand Up @@ -2489,6 +2512,11 @@ typedef NS_ENUM(NSInteger, AWSDynamoDBTimeToLiveStatus) {
*/
@property (nonatomic, assign) AWSDynamoDBExportStatus exportStatus;

/**
<p>The type of export that was performed. Valid values are <code>FULL_EXPORT</code> or <code>INCREMENTAL_EXPORT</code>.</p>
*/
@property (nonatomic, assign) AWSDynamoDBExportType exportType;

@end

/**
Expand All @@ -2512,6 +2540,16 @@ typedef NS_ENUM(NSInteger, AWSDynamoDBTimeToLiveStatus) {
*/
@property (nonatomic, strong) NSDate * _Nullable exportTime;

/**
<p>Choice of whether to execute as a full export or incremental export. Valid values are FULL_EXPORT or INCREMENTAL_EXPORT. The default value is FULL_EXPORT. If INCREMENTAL_EXPORT is provided, the IncrementalExportSpecification must also be used.</p>
*/
@property (nonatomic, assign) AWSDynamoDBExportType exportType;

/**
<p>Optional object containing the parameters specific to an incremental export.</p>
*/
@property (nonatomic, strong) AWSDynamoDBIncrementalExportSpecification * _Nullable incrementalExportSpecification;

/**
<p>The name of the Amazon S3 bucket to export the snapshot to.</p>
*/
Expand Down Expand Up @@ -3094,6 +3132,29 @@ typedef NS_ENUM(NSInteger, AWSDynamoDBTimeToLiveStatus) {

@end

/**
<p>Optional object containing the parameters specific to an incremental export.</p>
*/
@interface AWSDynamoDBIncrementalExportSpecification : AWSModel


/**
<p>Time in the past which provides the inclusive start range for the export table's data, counted in seconds from the start of the Unix epoch. The incremental export will reflect the table's state including and after this point in time.</p>
*/
@property (nonatomic, strong) NSDate * _Nullable exportFromTime;

/**
<p>Time in the past which provides the exclusive end range for the export table's data, counted in seconds from the start of the Unix epoch. The incremental export will reflect the table's state just prior to this point in time. If this is not provided, the latest time with data available will be used.</p>
*/
@property (nonatomic, strong) NSDate * _Nullable exportToTime;

/**
<p>The view type that was chosen for the export. Valid values are <code>NEW_AND_OLD_IMAGES</code> and <code>NEW_IMAGES</code>. The default value is <code>NEW_AND_OLD_IMAGES</code>.</p>
*/
@property (nonatomic, assign) AWSDynamoDBExportViewType exportViewType;

@end

/**
<p> The format options for the data that was imported into the target table. There is one value, CsvOption.</p>
*/
Expand Down Expand Up @@ -4710,7 +4771,7 @@ typedef NS_ENUM(NSInteger, AWSDynamoDBTimeToLiveStatus) {
@property (nonatomic, strong) NSDictionary<NSString *, AWSDynamoDBAttributeValue *> * _Nullable expressionAttributeValues;

/**
<p>A string that contains conditions that DynamoDB applies after the <code>Scan</code> operation, but before the data is returned to you. Items that do not satisfy the <code>FilterExpression</code> criteria are not returned.</p><note><p>A <code>FilterExpression</code> is applied after the items have already been read; the process of filtering does not consume any additional read capacity units.</p></note><p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Query.FilterExpression">Filter Expressions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
<p>A string that contains conditions that DynamoDB applies after the <code>Scan</code> operation, but before the data is returned to you. Items that do not satisfy the <code>FilterExpression</code> criteria are not returned.</p><note><p>A <code>FilterExpression</code> is applied after the items have already been read; the process of filtering does not consume any additional read capacity units.</p></note><p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.FilterExpression">Filter Expressions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
*/
@property (nonatomic, strong) NSString * _Nullable filterExpression;

Expand Down
129 changes: 129 additions & 0 deletions AWSDynamoDB/AWSDynamoDBModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -2718,8 +2718,10 @@ + (NSDictionary *)JSONKeyPathsByPropertyKey {
@"exportManifest" : @"ExportManifest",
@"exportStatus" : @"ExportStatus",
@"exportTime" : @"ExportTime",
@"exportType" : @"ExportType",
@"failureCode" : @"FailureCode",
@"failureMessage" : @"FailureMessage",
@"incrementalExportSpecification" : @"IncrementalExportSpecification",
@"itemCount" : @"ItemCount",
@"s3Bucket" : @"S3Bucket",
@"s3BucketOwner" : @"S3BucketOwner",
Expand Down Expand Up @@ -2795,6 +2797,31 @@ + (NSValueTransformer *)exportTimeJSONTransformer {
}];
}

+ (NSValueTransformer *)exportTypeJSONTransformer {
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^NSNumber *(NSString *value) {
if ([value caseInsensitiveCompare:@"FULL_EXPORT"] == NSOrderedSame) {
return @(AWSDynamoDBExportTypeFullExport);
}
if ([value caseInsensitiveCompare:@"INCREMENTAL_EXPORT"] == NSOrderedSame) {
return @(AWSDynamoDBExportTypeIncrementalExport);
}
return @(AWSDynamoDBExportTypeUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSDynamoDBExportTypeFullExport:
return @"FULL_EXPORT";
case AWSDynamoDBExportTypeIncrementalExport:
return @"INCREMENTAL_EXPORT";
default:
return nil;
}
}];
}

+ (NSValueTransformer *)incrementalExportSpecificationJSONTransformer {
return [NSValueTransformer awsmtl_JSONDictionaryTransformerWithModelClass:[AWSDynamoDBIncrementalExportSpecification class]];
}

+ (NSValueTransformer *)s3SseAlgorithmJSONTransformer {
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^NSNumber *(NSString *value) {
if ([value caseInsensitiveCompare:@"AES256"] == NSOrderedSame) {
Expand Down Expand Up @@ -2836,6 +2863,7 @@ + (NSDictionary *)JSONKeyPathsByPropertyKey {
return @{
@"exportArn" : @"ExportArn",
@"exportStatus" : @"ExportStatus",
@"exportType" : @"ExportType",
};
}

Expand Down Expand Up @@ -2865,6 +2893,27 @@ + (NSValueTransformer *)exportStatusJSONTransformer {
}];
}

+ (NSValueTransformer *)exportTypeJSONTransformer {
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^NSNumber *(NSString *value) {
if ([value caseInsensitiveCompare:@"FULL_EXPORT"] == NSOrderedSame) {
return @(AWSDynamoDBExportTypeFullExport);
}
if ([value caseInsensitiveCompare:@"INCREMENTAL_EXPORT"] == NSOrderedSame) {
return @(AWSDynamoDBExportTypeIncrementalExport);
}
return @(AWSDynamoDBExportTypeUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSDynamoDBExportTypeFullExport:
return @"FULL_EXPORT";
case AWSDynamoDBExportTypeIncrementalExport:
return @"INCREMENTAL_EXPORT";
default:
return nil;
}
}];
}

@end

@implementation AWSDynamoDBExportTableToPointInTimeInput
Expand All @@ -2878,6 +2927,8 @@ + (NSDictionary *)JSONKeyPathsByPropertyKey {
@"clientToken" : @"ClientToken",
@"exportFormat" : @"ExportFormat",
@"exportTime" : @"ExportTime",
@"exportType" : @"ExportType",
@"incrementalExportSpecification" : @"IncrementalExportSpecification",
@"s3Bucket" : @"S3Bucket",
@"s3BucketOwner" : @"S3BucketOwner",
@"s3Prefix" : @"S3Prefix",
Expand Down Expand Up @@ -2916,6 +2967,31 @@ + (NSValueTransformer *)exportTimeJSONTransformer {
}];
}

+ (NSValueTransformer *)exportTypeJSONTransformer {
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^NSNumber *(NSString *value) {
if ([value caseInsensitiveCompare:@"FULL_EXPORT"] == NSOrderedSame) {
return @(AWSDynamoDBExportTypeFullExport);
}
if ([value caseInsensitiveCompare:@"INCREMENTAL_EXPORT"] == NSOrderedSame) {
return @(AWSDynamoDBExportTypeIncrementalExport);
}
return @(AWSDynamoDBExportTypeUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSDynamoDBExportTypeFullExport:
return @"FULL_EXPORT";
case AWSDynamoDBExportTypeIncrementalExport:
return @"INCREMENTAL_EXPORT";
default:
return nil;
}
}];
}

+ (NSValueTransformer *)incrementalExportSpecificationJSONTransformer {
return [NSValueTransformer awsmtl_JSONDictionaryTransformerWithModelClass:[AWSDynamoDBIncrementalExportSpecification class]];
}

+ (NSValueTransformer *)s3SseAlgorithmJSONTransformer {
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^NSNumber *(NSString *value) {
if ([value caseInsensitiveCompare:@"AES256"] == NSOrderedSame) {
Expand Down Expand Up @@ -3700,6 +3776,59 @@ + (NSValueTransformer *)importTableDescriptionJSONTransformer {

@end

@implementation AWSDynamoDBIncrementalExportSpecification

+ (BOOL)supportsSecureCoding {
return YES;
}

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
return @{
@"exportFromTime" : @"ExportFromTime",
@"exportToTime" : @"ExportToTime",
@"exportViewType" : @"ExportViewType",
};
}

+ (NSValueTransformer *)exportFromTimeJSONTransformer {
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSNumber *number) {
return [NSDate dateWithTimeIntervalSince1970:[number doubleValue]];
} reverseBlock:^id(NSDate *date) {
return [NSString stringWithFormat:@"%f", [date timeIntervalSince1970]];
}];
}

+ (NSValueTransformer *)exportToTimeJSONTransformer {
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSNumber *number) {
return [NSDate dateWithTimeIntervalSince1970:[number doubleValue]];
} reverseBlock:^id(NSDate *date) {
return [NSString stringWithFormat:@"%f", [date timeIntervalSince1970]];
}];
}

+ (NSValueTransformer *)exportViewTypeJSONTransformer {
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^NSNumber *(NSString *value) {
if ([value caseInsensitiveCompare:@"NEW_IMAGE"] == NSOrderedSame) {
return @(AWSDynamoDBExportViewTypeNewImage);
}
if ([value caseInsensitiveCompare:@"NEW_AND_OLD_IMAGES"] == NSOrderedSame) {
return @(AWSDynamoDBExportViewTypeNewAndOldImages);
}
return @(AWSDynamoDBExportViewTypeUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSDynamoDBExportViewTypeNewImage:
return @"NEW_IMAGE";
case AWSDynamoDBExportViewTypeNewAndOldImages:
return @"NEW_AND_OLD_IMAGES";
default:
return nil;
}
}];
}

@end

@implementation AWSDynamoDBInputFormatOptions

+ (BOOL)supportsSecureCoding {
Expand Down
Loading

0 comments on commit 5b60fa8

Please sign in to comment.