Skip to content

Commit

Permalink
feat(AWSTranscribe): update models to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
awsmobilesdk committed Nov 27, 2023
1 parent de705c6 commit 9ed1a6e
Show file tree
Hide file tree
Showing 7 changed files with 10,102 additions and 220 deletions.
555 changes: 509 additions & 46 deletions AWSTranscribe/AWSTranscribeModel.h

Large diffs are not rendered by default.

8,772 changes: 8,648 additions & 124 deletions AWSTranscribe/AWSTranscribeModel.m

Large diffs are not rendered by default.

543 changes: 497 additions & 46 deletions AWSTranscribe/AWSTranscribeResources.m

Large diffs are not rendered by default.

105 changes: 101 additions & 4 deletions AWSTranscribe/AWSTranscribeService.h

Large diffs are not rendered by default.

91 changes: 91 additions & 0 deletions AWSTranscribe/AWSTranscribeService.m
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,28 @@ - (void)deleteLanguageModel:(AWSTranscribeDeleteLanguageModelRequest *)request
}];
}

- (AWSTask *)deleteMedicalScribeJob:(AWSTranscribeDeleteMedicalScribeJobRequest *)request {
return [self invokeRequest:request
HTTPMethod:AWSHTTPMethodPOST
URLString:@""
targetPrefix:@"Transcribe"
operationName:@"DeleteMedicalScribeJob"
outputClass:nil];
}

- (void)deleteMedicalScribeJob:(AWSTranscribeDeleteMedicalScribeJobRequest *)request
completionHandler:(void (^)(NSError *error))completionHandler {
[[self deleteMedicalScribeJob:request] continueWithBlock:^id _Nullable(AWSTask * _Nonnull task) {
NSError *error = task.error;

if (completionHandler) {
completionHandler(error);
}

return nil;
}];
}

- (AWSTask *)deleteMedicalTranscriptionJob:(AWSTranscribeDeleteMedicalTranscriptionJobRequest *)request {
return [self invokeRequest:request
HTTPMethod:AWSHTTPMethodPOST
Expand Down Expand Up @@ -640,6 +662,29 @@ - (void)getCallAnalyticsJob:(AWSTranscribeGetCallAnalyticsJobRequest *)request
}];
}

- (AWSTask<AWSTranscribeGetMedicalScribeJobResponse *> *)getMedicalScribeJob:(AWSTranscribeGetMedicalScribeJobRequest *)request {
return [self invokeRequest:request
HTTPMethod:AWSHTTPMethodPOST
URLString:@""
targetPrefix:@"Transcribe"
operationName:@"GetMedicalScribeJob"
outputClass:[AWSTranscribeGetMedicalScribeJobResponse class]];
}

- (void)getMedicalScribeJob:(AWSTranscribeGetMedicalScribeJobRequest *)request
completionHandler:(void (^)(AWSTranscribeGetMedicalScribeJobResponse *response, NSError *error))completionHandler {
[[self getMedicalScribeJob:request] continueWithBlock:^id _Nullable(AWSTask<AWSTranscribeGetMedicalScribeJobResponse *> * _Nonnull task) {
AWSTranscribeGetMedicalScribeJobResponse *result = task.result;
NSError *error = task.error;

if (completionHandler) {
completionHandler(result, error);
}

return nil;
}];
}

- (AWSTask<AWSTranscribeGetMedicalTranscriptionJobResponse *> *)getMedicalTranscriptionJob:(AWSTranscribeGetMedicalTranscriptionJobRequest *)request {
return [self invokeRequest:request
HTTPMethod:AWSHTTPMethodPOST
Expand Down Expand Up @@ -824,6 +869,29 @@ - (void)listLanguageModels:(AWSTranscribeListLanguageModelsRequest *)request
}];
}

- (AWSTask<AWSTranscribeListMedicalScribeJobsResponse *> *)listMedicalScribeJobs:(AWSTranscribeListMedicalScribeJobsRequest *)request {
return [self invokeRequest:request
HTTPMethod:AWSHTTPMethodPOST
URLString:@""
targetPrefix:@"Transcribe"
operationName:@"ListMedicalScribeJobs"
outputClass:[AWSTranscribeListMedicalScribeJobsResponse class]];
}

- (void)listMedicalScribeJobs:(AWSTranscribeListMedicalScribeJobsRequest *)request
completionHandler:(void (^)(AWSTranscribeListMedicalScribeJobsResponse *response, NSError *error))completionHandler {
[[self listMedicalScribeJobs:request] continueWithBlock:^id _Nullable(AWSTask<AWSTranscribeListMedicalScribeJobsResponse *> * _Nonnull task) {
AWSTranscribeListMedicalScribeJobsResponse *result = task.result;
NSError *error = task.error;

if (completionHandler) {
completionHandler(result, error);
}

return nil;
}];
}

- (AWSTask<AWSTranscribeListMedicalTranscriptionJobsResponse *> *)listMedicalTranscriptionJobs:(AWSTranscribeListMedicalTranscriptionJobsRequest *)request {
return [self invokeRequest:request
HTTPMethod:AWSHTTPMethodPOST
Expand Down Expand Up @@ -985,6 +1053,29 @@ - (void)startCallAnalyticsJob:(AWSTranscribeStartCallAnalyticsJobRequest *)reque
}];
}

- (AWSTask<AWSTranscribeStartMedicalScribeJobResponse *> *)startMedicalScribeJob:(AWSTranscribeStartMedicalScribeJobRequest *)request {
return [self invokeRequest:request
HTTPMethod:AWSHTTPMethodPOST
URLString:@""
targetPrefix:@"Transcribe"
operationName:@"StartMedicalScribeJob"
outputClass:[AWSTranscribeStartMedicalScribeJobResponse class]];
}

- (void)startMedicalScribeJob:(AWSTranscribeStartMedicalScribeJobRequest *)request
completionHandler:(void (^)(AWSTranscribeStartMedicalScribeJobResponse *response, NSError *error))completionHandler {
[[self startMedicalScribeJob:request] continueWithBlock:^id _Nullable(AWSTask<AWSTranscribeStartMedicalScribeJobResponse *> * _Nonnull task) {
AWSTranscribeStartMedicalScribeJobResponse *result = task.result;
NSError *error = task.error;

if (completionHandler) {
completionHandler(result, error);
}

return nil;
}];
}

- (AWSTask<AWSTranscribeStartMedicalTranscriptionJobResponse *> *)startMedicalTranscriptionJob:(AWSTranscribeStartMedicalTranscriptionJobRequest *)request {
return [self invokeRequest:request
HTTPMethod:AWSHTTPMethodPOST
Expand Down
191 changes: 191 additions & 0 deletions AWSTranscribeUnitTests/AWSGeneralTranscribeTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,53 @@ - (void)testDeleteLanguageModelCompletionHandler {
[AWSTranscribe removeTranscribeForKey:key];
}

- (void)testDeleteMedicalScribeJob {
NSString *key = @"testDeleteMedicalScribeJob";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
[AWSTranscribe registerTranscribeWithConfiguration:configuration forKey:key];

AWSTranscribe *awsClient = [AWSTranscribe TranscribeForKey:key];
XCTAssertNotNil(awsClient);
XCTAssertNotNil(mockNetworking);
[awsClient setValue:mockNetworking forKey:@"networking"];
[[[[AWSTranscribe TranscribeForKey:key] deleteMedicalScribeJob:[AWSTranscribeDeleteMedicalScribeJobRequest new]] continueWithBlock:^id(AWSTask *task) {
XCTAssertNotNil(task.error);
XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain);
XCTAssertEqual(8848, task.error.code);
XCTAssertNil(task.result);
return nil;
}] waitUntilFinished];

OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]);

[AWSTranscribe removeTranscribeForKey:key];
}

- (void)testDeleteMedicalScribeJobCompletionHandler {
NSString *key = @"testDeleteMedicalScribeJob";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
[AWSTranscribe registerTranscribeWithConfiguration:configuration forKey:key];

AWSTranscribe *awsClient = [AWSTranscribe TranscribeForKey:key];
XCTAssertNotNil(awsClient);
XCTAssertNotNil(mockNetworking);
[awsClient setValue:mockNetworking forKey:@"networking"];

dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

[[AWSTranscribe TranscribeForKey:key] deleteMedicalScribeJob:[AWSTranscribeDeleteMedicalScribeJobRequest new] completionHandler:^(NSError * _Nullable error) {
XCTAssertNotNil(error);
XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain);
XCTAssertEqual(8848, error.code);
dispatch_semaphore_signal(semaphore);
}];

dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC)));
OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]);

[AWSTranscribe removeTranscribeForKey:key];
}

- (void)testDeleteMedicalTranscriptionJob {
NSString *key = @"testDeleteMedicalTranscriptionJob";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
Expand Down Expand Up @@ -819,6 +866,54 @@ - (void)testGetCallAnalyticsJobCompletionHandler {
[AWSTranscribe removeTranscribeForKey:key];
}

- (void)testGetMedicalScribeJob {
NSString *key = @"testGetMedicalScribeJob";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
[AWSTranscribe registerTranscribeWithConfiguration:configuration forKey:key];

AWSTranscribe *awsClient = [AWSTranscribe TranscribeForKey:key];
XCTAssertNotNil(awsClient);
XCTAssertNotNil(mockNetworking);
[awsClient setValue:mockNetworking forKey:@"networking"];
[[[[AWSTranscribe TranscribeForKey:key] getMedicalScribeJob:[AWSTranscribeGetMedicalScribeJobRequest new]] continueWithBlock:^id(AWSTask *task) {
XCTAssertNotNil(task.error);
XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain);
XCTAssertEqual(8848, task.error.code);
XCTAssertNil(task.result);
return nil;
}] waitUntilFinished];

OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]);

[AWSTranscribe removeTranscribeForKey:key];
}

- (void)testGetMedicalScribeJobCompletionHandler {
NSString *key = @"testGetMedicalScribeJob";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
[AWSTranscribe registerTranscribeWithConfiguration:configuration forKey:key];

AWSTranscribe *awsClient = [AWSTranscribe TranscribeForKey:key];
XCTAssertNotNil(awsClient);
XCTAssertNotNil(mockNetworking);
[awsClient setValue:mockNetworking forKey:@"networking"];

dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

[[AWSTranscribe TranscribeForKey:key] getMedicalScribeJob:[AWSTranscribeGetMedicalScribeJobRequest new] completionHandler:^(AWSTranscribeGetMedicalScribeJobResponse* _Nullable response, NSError * _Nullable error) {
XCTAssertNotNil(error);
XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain);
XCTAssertEqual(8848, error.code);
XCTAssertNil(response);
dispatch_semaphore_signal(semaphore);
}];

dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC)));
OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]);

[AWSTranscribe removeTranscribeForKey:key];
}

- (void)testGetMedicalTranscriptionJob {
NSString *key = @"testGetMedicalTranscriptionJob";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
Expand Down Expand Up @@ -1203,6 +1298,54 @@ - (void)testListLanguageModelsCompletionHandler {
[AWSTranscribe removeTranscribeForKey:key];
}

- (void)testListMedicalScribeJobs {
NSString *key = @"testListMedicalScribeJobs";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
[AWSTranscribe registerTranscribeWithConfiguration:configuration forKey:key];

AWSTranscribe *awsClient = [AWSTranscribe TranscribeForKey:key];
XCTAssertNotNil(awsClient);
XCTAssertNotNil(mockNetworking);
[awsClient setValue:mockNetworking forKey:@"networking"];
[[[[AWSTranscribe TranscribeForKey:key] listMedicalScribeJobs:[AWSTranscribeListMedicalScribeJobsRequest new]] continueWithBlock:^id(AWSTask *task) {
XCTAssertNotNil(task.error);
XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain);
XCTAssertEqual(8848, task.error.code);
XCTAssertNil(task.result);
return nil;
}] waitUntilFinished];

OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]);

[AWSTranscribe removeTranscribeForKey:key];
}

- (void)testListMedicalScribeJobsCompletionHandler {
NSString *key = @"testListMedicalScribeJobs";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
[AWSTranscribe registerTranscribeWithConfiguration:configuration forKey:key];

AWSTranscribe *awsClient = [AWSTranscribe TranscribeForKey:key];
XCTAssertNotNil(awsClient);
XCTAssertNotNil(mockNetworking);
[awsClient setValue:mockNetworking forKey:@"networking"];

dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

[[AWSTranscribe TranscribeForKey:key] listMedicalScribeJobs:[AWSTranscribeListMedicalScribeJobsRequest new] completionHandler:^(AWSTranscribeListMedicalScribeJobsResponse* _Nullable response, NSError * _Nullable error) {
XCTAssertNotNil(error);
XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain);
XCTAssertEqual(8848, error.code);
XCTAssertNil(response);
dispatch_semaphore_signal(semaphore);
}];

dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC)));
OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]);

[AWSTranscribe removeTranscribeForKey:key];
}

- (void)testListMedicalTranscriptionJobs {
NSString *key = @"testListMedicalTranscriptionJobs";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
Expand Down Expand Up @@ -1539,6 +1682,54 @@ - (void)testStartCallAnalyticsJobCompletionHandler {
[AWSTranscribe removeTranscribeForKey:key];
}

- (void)testStartMedicalScribeJob {
NSString *key = @"testStartMedicalScribeJob";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
[AWSTranscribe registerTranscribeWithConfiguration:configuration forKey:key];

AWSTranscribe *awsClient = [AWSTranscribe TranscribeForKey:key];
XCTAssertNotNil(awsClient);
XCTAssertNotNil(mockNetworking);
[awsClient setValue:mockNetworking forKey:@"networking"];
[[[[AWSTranscribe TranscribeForKey:key] startMedicalScribeJob:[AWSTranscribeStartMedicalScribeJobRequest new]] continueWithBlock:^id(AWSTask *task) {
XCTAssertNotNil(task.error);
XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", task.error.domain);
XCTAssertEqual(8848, task.error.code);
XCTAssertNil(task.result);
return nil;
}] waitUntilFinished];

OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]);

[AWSTranscribe removeTranscribeForKey:key];
}

- (void)testStartMedicalScribeJobCompletionHandler {
NSString *key = @"testStartMedicalScribeJob";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
[AWSTranscribe registerTranscribeWithConfiguration:configuration forKey:key];

AWSTranscribe *awsClient = [AWSTranscribe TranscribeForKey:key];
XCTAssertNotNil(awsClient);
XCTAssertNotNil(mockNetworking);
[awsClient setValue:mockNetworking forKey:@"networking"];

dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

[[AWSTranscribe TranscribeForKey:key] startMedicalScribeJob:[AWSTranscribeStartMedicalScribeJobRequest new] completionHandler:^(AWSTranscribeStartMedicalScribeJobResponse* _Nullable response, NSError * _Nullable error) {
XCTAssertNotNil(error);
XCTAssertEqualObjects(@"OCMockExpectedNetworkingError", error.domain);
XCTAssertEqual(8848, error.code);
XCTAssertNil(response);
dispatch_semaphore_signal(semaphore);
}];

dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, (int)(2.0 * NSEC_PER_SEC)));
OCMVerify([mockNetworking sendRequest:[OCMArg isNotNil]]);

[AWSTranscribe removeTranscribeForKey:key];
}

- (void)testStartMedicalTranscriptionJob {
NSString *key = @"testStartMedicalTranscriptionJob";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
Expand Down
Loading

0 comments on commit 9ed1a6e

Please sign in to comment.