Skip to content

Commit

Permalink
feat(AWSComprehend): update models to latest (#5110)
Browse files Browse the repository at this point in the history
  • Loading branch information
awsmobilesdk authored Dec 28, 2023
1 parent 4ba0e5f commit c48991d
Show file tree
Hide file tree
Showing 7 changed files with 602 additions and 75 deletions.
157 changes: 127 additions & 30 deletions AWSComprehend/AWSComprehendModel.h

Large diffs are not rendered by default.

202 changes: 202 additions & 0 deletions AWSComprehend/AWSComprehendModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -3253,6 +3253,114 @@ + (NSValueTransformer *)entitiesJSONTransformer {

@end

@implementation AWSComprehendDetectToxicContentRequest

+ (BOOL)supportsSecureCoding {
return YES;
}

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
return @{
@"languageCode" : @"LanguageCode",
@"textSegments" : @"TextSegments",
};
}

+ (NSValueTransformer *)languageCodeJSONTransformer {
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^NSNumber *(NSString *value) {
if ([value caseInsensitiveCompare:@"en"] == NSOrderedSame) {
return @(AWSComprehendLanguageCodeEn);
}
if ([value caseInsensitiveCompare:@"es"] == NSOrderedSame) {
return @(AWSComprehendLanguageCodeEs);
}
if ([value caseInsensitiveCompare:@"fr"] == NSOrderedSame) {
return @(AWSComprehendLanguageCodeFr);
}
if ([value caseInsensitiveCompare:@"de"] == NSOrderedSame) {
return @(AWSComprehendLanguageCodeDe);
}
if ([value caseInsensitiveCompare:@"it"] == NSOrderedSame) {
return @(AWSComprehendLanguageCodeIt);
}
if ([value caseInsensitiveCompare:@"pt"] == NSOrderedSame) {
return @(AWSComprehendLanguageCodePt);
}
if ([value caseInsensitiveCompare:@"ar"] == NSOrderedSame) {
return @(AWSComprehendLanguageCodeAr);
}
if ([value caseInsensitiveCompare:@"hi"] == NSOrderedSame) {
return @(AWSComprehendLanguageCodeHi);
}
if ([value caseInsensitiveCompare:@"ja"] == NSOrderedSame) {
return @(AWSComprehendLanguageCodeJa);
}
if ([value caseInsensitiveCompare:@"ko"] == NSOrderedSame) {
return @(AWSComprehendLanguageCodeKo);
}
if ([value caseInsensitiveCompare:@"zh"] == NSOrderedSame) {
return @(AWSComprehendLanguageCodeZh);
}
if ([value caseInsensitiveCompare:@"zh-TW"] == NSOrderedSame) {
return @(AWSComprehendLanguageCodeZhTW);
}
return @(AWSComprehendLanguageCodeUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSComprehendLanguageCodeEn:
return @"en";
case AWSComprehendLanguageCodeEs:
return @"es";
case AWSComprehendLanguageCodeFr:
return @"fr";
case AWSComprehendLanguageCodeDe:
return @"de";
case AWSComprehendLanguageCodeIt:
return @"it";
case AWSComprehendLanguageCodePt:
return @"pt";
case AWSComprehendLanguageCodeAr:
return @"ar";
case AWSComprehendLanguageCodeHi:
return @"hi";
case AWSComprehendLanguageCodeJa:
return @"ja";
case AWSComprehendLanguageCodeKo:
return @"ko";
case AWSComprehendLanguageCodeZh:
return @"zh";
case AWSComprehendLanguageCodeZhTW:
return @"zh-TW";
default:
return nil;
}
}];
}

+ (NSValueTransformer *)textSegmentsJSONTransformer {
return [NSValueTransformer awsmtl_JSONArrayTransformerWithModelClass:[AWSComprehendTextSegment class]];
}

@end

@implementation AWSComprehendDetectToxicContentResponse

+ (BOOL)supportsSecureCoding {
return YES;
}

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
return @{
@"resultList" : @"ResultList",
};
}

+ (NSValueTransformer *)resultListJSONTransformer {
return [NSValueTransformer awsmtl_JSONArrayTransformerWithModelClass:[AWSComprehendToxicLabels class]];
}

@end

@implementation AWSComprehendDocumentClass

+ (BOOL)supportsSecureCoding {
Expand Down Expand Up @@ -10833,6 +10941,20 @@ + (NSValueTransformer *)languageCodeJSONTransformer {

@end

@implementation AWSComprehendTextSegment

+ (BOOL)supportsSecureCoding {
return YES;
}

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
return @{
@"text" : @"Text",
};
}

@end

@implementation AWSComprehendTopicsDetectionJobFilter

+ (BOOL)supportsSecureCoding {
Expand Down Expand Up @@ -11002,6 +11124,86 @@ + (NSValueTransformer *)vpcConfigJSONTransformer {

@end

@implementation AWSComprehendToxicContent

+ (BOOL)supportsSecureCoding {
return YES;
}

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
return @{
@"name" : @"Name",
@"score" : @"Score",
};
}

+ (NSValueTransformer *)nameJSONTransformer {
return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^NSNumber *(NSString *value) {
if ([value caseInsensitiveCompare:@"GRAPHIC"] == NSOrderedSame) {
return @(AWSComprehendToxicContentTypeGraphic);
}
if ([value caseInsensitiveCompare:@"HARASSMENT_OR_ABUSE"] == NSOrderedSame) {
return @(AWSComprehendToxicContentTypeHarassmentOrAbuse);
}
if ([value caseInsensitiveCompare:@"HATE_SPEECH"] == NSOrderedSame) {
return @(AWSComprehendToxicContentTypeHateSpeech);
}
if ([value caseInsensitiveCompare:@"INSULT"] == NSOrderedSame) {
return @(AWSComprehendToxicContentTypeInsult);
}
if ([value caseInsensitiveCompare:@"PROFANITY"] == NSOrderedSame) {
return @(AWSComprehendToxicContentTypeProfanity);
}
if ([value caseInsensitiveCompare:@"SEXUAL"] == NSOrderedSame) {
return @(AWSComprehendToxicContentTypeSexual);
}
if ([value caseInsensitiveCompare:@"VIOLENCE_OR_THREAT"] == NSOrderedSame) {
return @(AWSComprehendToxicContentTypeViolenceOrThreat);
}
return @(AWSComprehendToxicContentTypeUnknown);
} reverseBlock:^NSString *(NSNumber *value) {
switch ([value integerValue]) {
case AWSComprehendToxicContentTypeGraphic:
return @"GRAPHIC";
case AWSComprehendToxicContentTypeHarassmentOrAbuse:
return @"HARASSMENT_OR_ABUSE";
case AWSComprehendToxicContentTypeHateSpeech:
return @"HATE_SPEECH";
case AWSComprehendToxicContentTypeInsult:
return @"INSULT";
case AWSComprehendToxicContentTypeProfanity:
return @"PROFANITY";
case AWSComprehendToxicContentTypeSexual:
return @"SEXUAL";
case AWSComprehendToxicContentTypeViolenceOrThreat:
return @"VIOLENCE_OR_THREAT";
default:
return nil;
}
}];
}

@end

@implementation AWSComprehendToxicLabels

+ (BOOL)supportsSecureCoding {
return YES;
}

+ (NSDictionary *)JSONKeyPathsByPropertyKey {
return @{
@"labels" : @"Labels",
@"toxicity" : @"Toxicity",
};
}

+ (NSValueTransformer *)labelsJSONTransformer {
return [NSValueTransformer awsmtl_JSONArrayTransformerWithModelClass:[AWSComprehendToxicContent class]];
}

@end

@implementation AWSComprehendUntagResourceRequest

+ (BOOL)supportsSecureCoding {
Expand Down
Loading

0 comments on commit c48991d

Please sign in to comment.