Skip to content

Commit

Permalink
feat(AWSEC2): update models to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
awsmobilesdk committed Oct 12, 2023
1 parent a2bf4fa commit 7468e78
Show file tree
Hide file tree
Showing 7 changed files with 4,054 additions and 69 deletions.
252 changes: 231 additions & 21 deletions AWSEC2/AWSEC2Model.h

Large diffs are not rendered by default.

3,362 changes: 3,362 additions & 0 deletions AWSEC2/AWSEC2Model.m

Large diffs are not rendered by default.

267 changes: 229 additions & 38 deletions AWSEC2/AWSEC2Resources.m

Large diffs are not rendered by default.

70 changes: 60 additions & 10 deletions AWSEC2/AWSEC2Service.h

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions AWSEC2/AWSEC2Service.m
Original file line number Diff line number Diff line change
Expand Up @@ -8820,6 +8820,29 @@ - (void)disableFastSnapshotRestores:(AWSEC2DisableFastSnapshotRestoresRequest *)
}];
}

- (AWSTask<AWSEC2DisableImageResult *> *)disableImage:(AWSEC2DisableImageRequest *)request {
return [self invokeRequest:request
HTTPMethod:AWSHTTPMethodPOST
URLString:@""
targetPrefix:@""
operationName:@"DisableImage"
outputClass:[AWSEC2DisableImageResult class]];
}

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

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

return nil;
}];
}

- (AWSTask<AWSEC2DisableImageBlockPublicAccessResult *> *)disableImageBlockPublicAccess:(AWSEC2DisableImageBlockPublicAccessRequest *)request {
return [self invokeRequest:request
HTTPMethod:AWSHTTPMethodPOST
Expand Down Expand Up @@ -9438,6 +9461,29 @@ - (void)enableFastSnapshotRestores:(AWSEC2EnableFastSnapshotRestoresRequest *)re
}];
}

- (AWSTask<AWSEC2EnableImageResult *> *)enableImage:(AWSEC2EnableImageRequest *)request {
return [self invokeRequest:request
HTTPMethod:AWSHTTPMethodPOST
URLString:@""
targetPrefix:@""
operationName:@"EnableImage"
outputClass:[AWSEC2EnableImageResult class]];
}

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

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

return nil;
}];
}

- (AWSTask<AWSEC2EnableImageBlockPublicAccessResult *> *)enableImageBlockPublicAccess:(AWSEC2EnableImageBlockPublicAccessRequest *)request {
return [self invokeRequest:request
HTTPMethod:AWSHTTPMethodPOST
Expand Down
30 changes: 30 additions & 0 deletions AWSEC2UnitTests/AWSEC2NSSecureCodingTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,8 @@ - (void) test_AWSEC2DisableImageBlockPublicAccessRequest API_AVAILABLE(ios(11));
- (void) test_AWSEC2DisableImageBlockPublicAccessResult API_AVAILABLE(ios(11));
- (void) test_AWSEC2DisableImageDeprecationRequest API_AVAILABLE(ios(11));
- (void) test_AWSEC2DisableImageDeprecationResult API_AVAILABLE(ios(11));
- (void) test_AWSEC2DisableImageRequest API_AVAILABLE(ios(11));
- (void) test_AWSEC2DisableImageResult API_AVAILABLE(ios(11));
- (void) test_AWSEC2DisableIpamOrganizationAdminAccountRequest API_AVAILABLE(ios(11));
- (void) test_AWSEC2DisableIpamOrganizationAdminAccountResult API_AVAILABLE(ios(11));
- (void) test_AWSEC2DisableSerialConsoleAccessRequest API_AVAILABLE(ios(11));
Expand Down Expand Up @@ -950,6 +952,8 @@ - (void) test_AWSEC2EnableImageBlockPublicAccessRequest API_AVAILABLE(ios(11));
- (void) test_AWSEC2EnableImageBlockPublicAccessResult API_AVAILABLE(ios(11));
- (void) test_AWSEC2EnableImageDeprecationRequest API_AVAILABLE(ios(11));
- (void) test_AWSEC2EnableImageDeprecationResult API_AVAILABLE(ios(11));
- (void) test_AWSEC2EnableImageRequest API_AVAILABLE(ios(11));
- (void) test_AWSEC2EnableImageResult API_AVAILABLE(ios(11));
- (void) test_AWSEC2EnableIpamOrganizationAdminAccountRequest API_AVAILABLE(ios(11));
- (void) test_AWSEC2EnableIpamOrganizationAdminAccountResult API_AVAILABLE(ios(11));
- (void) test_AWSEC2EnableReachabilityAnalyzerOrganizationSharingRequest API_AVAILABLE(ios(11));
Expand Down Expand Up @@ -1824,6 +1828,8 @@ - (void) test_AWSEC2VerifiedAccessLogOptions API_AVAILABLE(ios(11));
- (void) test_AWSEC2VerifiedAccessLogS3Destination API_AVAILABLE(ios(11));
- (void) test_AWSEC2VerifiedAccessLogS3DestinationOptions API_AVAILABLE(ios(11));
- (void) test_AWSEC2VerifiedAccessLogs API_AVAILABLE(ios(11));
- (void) test_AWSEC2VerifiedAccessSseSpecificationRequest API_AVAILABLE(ios(11));
- (void) test_AWSEC2VerifiedAccessSseSpecificationResponse API_AVAILABLE(ios(11));
- (void) test_AWSEC2VerifiedAccessTrustProvider API_AVAILABLE(ios(11));
- (void) test_AWSEC2VerifiedAccessTrustProviderCondensed API_AVAILABLE(ios(11));
- (void) test_AWSEC2VgwTelemetry API_AVAILABLE(ios(11));
Expand Down Expand Up @@ -5265,6 +5271,14 @@ - (void) test_AWSEC2DisableImageDeprecationResult {
[self validateSecureCodingForClass:[AWSEC2DisableImageDeprecationResult class]];
}

- (void) test_AWSEC2DisableImageRequest {
[self validateSecureCodingForClass:[AWSEC2DisableImageRequest class]];
}

- (void) test_AWSEC2DisableImageResult {
[self validateSecureCodingForClass:[AWSEC2DisableImageResult class]];
}

- (void) test_AWSEC2DisableIpamOrganizationAdminAccountRequest {
[self validateSecureCodingForClass:[AWSEC2DisableIpamOrganizationAdminAccountRequest class]];
}
Expand Down Expand Up @@ -5589,6 +5603,14 @@ - (void) test_AWSEC2EnableImageDeprecationResult {
[self validateSecureCodingForClass:[AWSEC2EnableImageDeprecationResult class]];
}

- (void) test_AWSEC2EnableImageRequest {
[self validateSecureCodingForClass:[AWSEC2EnableImageRequest class]];
}

- (void) test_AWSEC2EnableImageResult {
[self validateSecureCodingForClass:[AWSEC2EnableImageResult class]];
}

- (void) test_AWSEC2EnableIpamOrganizationAdminAccountRequest {
[self validateSecureCodingForClass:[AWSEC2EnableIpamOrganizationAdminAccountRequest class]];
}
Expand Down Expand Up @@ -9085,6 +9107,14 @@ - (void) test_AWSEC2VerifiedAccessLogs {
[self validateSecureCodingForClass:[AWSEC2VerifiedAccessLogs class]];
}

- (void) test_AWSEC2VerifiedAccessSseSpecificationRequest {
[self validateSecureCodingForClass:[AWSEC2VerifiedAccessSseSpecificationRequest class]];
}

- (void) test_AWSEC2VerifiedAccessSseSpecificationResponse {
[self validateSecureCodingForClass:[AWSEC2VerifiedAccessSseSpecificationResponse class]];
}

- (void) test_AWSEC2VerifiedAccessTrustProvider {
[self validateSecureCodingForClass:[AWSEC2VerifiedAccessTrustProvider class]];
}
Expand Down
96 changes: 96 additions & 0 deletions AWSEC2UnitTests/AWSGeneralEC2Tests.m
Original file line number Diff line number Diff line change
Expand Up @@ -17931,6 +17931,54 @@ - (void)testDisableFastSnapshotRestoresCompletionHandler {
[AWSEC2 removeEC2ForKey:key];
}

- (void)testDisableImage {
NSString *key = @"testDisableImage";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
[AWSEC2 registerEC2WithConfiguration:configuration forKey:key];

AWSEC2 *awsClient = [AWSEC2 EC2ForKey:key];
XCTAssertNotNil(awsClient);
XCTAssertNotNil(mockNetworking);
[awsClient setValue:mockNetworking forKey:@"networking"];
[[[[AWSEC2 EC2ForKey:key] disableImage:[AWSEC2DisableImageRequest 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]]);

[AWSEC2 removeEC2ForKey:key];
}

- (void)testDisableImageCompletionHandler {
NSString *key = @"testDisableImage";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
[AWSEC2 registerEC2WithConfiguration:configuration forKey:key];

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

dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

[[AWSEC2 EC2ForKey:key] disableImage:[AWSEC2DisableImageRequest new] completionHandler:^(AWSEC2DisableImageResult* _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]]);

[AWSEC2 removeEC2ForKey:key];
}

- (void)testDisableImageBlockPublicAccess {
NSString *key = @"testDisableImageBlockPublicAccess";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
Expand Down Expand Up @@ -19224,6 +19272,54 @@ - (void)testEnableFastSnapshotRestoresCompletionHandler {
[AWSEC2 removeEC2ForKey:key];
}

- (void)testEnableImage {
NSString *key = @"testEnableImage";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
[AWSEC2 registerEC2WithConfiguration:configuration forKey:key];

AWSEC2 *awsClient = [AWSEC2 EC2ForKey:key];
XCTAssertNotNil(awsClient);
XCTAssertNotNil(mockNetworking);
[awsClient setValue:mockNetworking forKey:@"networking"];
[[[[AWSEC2 EC2ForKey:key] enableImage:[AWSEC2EnableImageRequest 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]]);

[AWSEC2 removeEC2ForKey:key];
}

- (void)testEnableImageCompletionHandler {
NSString *key = @"testEnableImage";
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1 credentialsProvider:nil];
[AWSEC2 registerEC2WithConfiguration:configuration forKey:key];

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

dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

[[AWSEC2 EC2ForKey:key] enableImage:[AWSEC2EnableImageRequest new] completionHandler:^(AWSEC2EnableImageResult* _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]]);

[AWSEC2 removeEC2ForKey:key];
}

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

0 comments on commit 7468e78

Please sign in to comment.