Skip to content

Commit b05cc2d

Browse files
committed
add tests
1 parent a06bf9e commit b05cc2d

File tree

12 files changed

+520
-40
lines changed

12 files changed

+520
-40
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2025-04-02T06:56:55Z"
3-
build_hash: cccb1805b425c5a5e2bb8b99e22b0a811e2896e2
4-
go_version: go1.24.0
5-
version: v0.43.2-12-gcccb180
6-
api_directory_checksum: 91f02f81a14b3f546bfdb8152e0f23c05f104d86
2+
build_date: "2025-04-04T16:03:06Z"
3+
build_hash: f5a9ac2db3296fac3aa18dacf282267b15229ad1
4+
go_version: go1.24.1
5+
version: v0.44.0-2-gf5a9ac2-dirty
6+
api_directory_checksum: df5c1e5fa783264de35389e169204fc261cbc083
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6
99
generator_config_info:
10-
file_checksum: f74adf069b573ea19ac1a9af85ea8b7abf5bc436
10+
file_checksum: 18e137510a9a6282689557f783727cb06dc03f0c
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ operations:
99
operation_type:
1010
- Create
1111
resource_name: ApiIntegrationResponse
12+
DeleteIntegrationResponse:
13+
operation_type:
14+
- Delete
15+
resource_name: ApiIntegrationResponse
16+
UpdateIntegrationResponse:
17+
operation_type:
18+
- Update
19+
resource_name: ApiIntegrationResponse
20+
GetIntegrationResponse:
21+
operation_type:
22+
- READ_ONE
23+
resource_name: ApiIntegrationResponse
1224
ignore:
1325
resource_names:
1426
- ApiKey
@@ -224,15 +236,11 @@ resources:
224236
StatusCode:
225237
is_required: true
226238
is_immutable: true
227-
# ResponseParameters:
228-
# type: "map[string]*string"
229-
# ResponseTemplates:
230-
# type: "map[string]*string"
231239
tags:
232240
ignore: true
233-
# hooks:
234-
# sdk_update_post_build_request:
235-
# template_path: hooks/integration_response/sdk_update_post_build_request.go.tpl
241+
hooks:
242+
sdk_update_post_build_request:
243+
template_path: hooks/integration_response/sdk_update_post_build_request.go.tpl
236244
exceptions:
237245
terminal_codes:
238246
- BadRequestException

generator.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ operations:
99
operation_type:
1010
- Create
1111
resource_name: ApiIntegrationResponse
12+
DeleteIntegrationResponse:
13+
operation_type:
14+
- Delete
15+
resource_name: ApiIntegrationResponse
16+
UpdateIntegrationResponse:
17+
operation_type:
18+
- Update
19+
resource_name: ApiIntegrationResponse
20+
GetIntegrationResponse:
21+
operation_type:
22+
- READ_ONE
23+
resource_name: ApiIntegrationResponse
1224
ignore:
1325
resource_names:
1426
- ApiKey
@@ -224,15 +236,11 @@ resources:
224236
StatusCode:
225237
is_required: true
226238
is_immutable: true
227-
# ResponseParameters:
228-
# type: "map[string]*string"
229-
# ResponseTemplates:
230-
# type: "map[string]*string"
231239
tags:
232240
ignore: true
233-
# hooks:
234-
# sdk_update_post_build_request:
235-
# template_path: hooks/integration_response/sdk_update_post_build_request.go.tpl
241+
hooks:
242+
sdk_update_post_build_request:
243+
template_path: hooks/integration_response/sdk_update_post_build_request.go.tpl
236244
exceptions:
237245
terminal_codes:
238246
- BadRequestException
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License"). You may
4+
// not use this file except in compliance with the License. A copy of the
5+
// License is located at
6+
//
7+
// http://aws.amazon.com/apache2.0/
8+
//
9+
// or in the "license" file accompanying this file. This file is distributed
10+
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11+
// express or implied. See the License for the specific language governing
12+
// permissions and limitations under the License.
13+
14+
package api_integration_response
15+
16+
import (
17+
"github.com/aws-controllers-k8s/runtime/pkg/compare"
18+
svcsdk "github.com/aws/aws-sdk-go-v2/service/apigateway"
19+
20+
"github.com/aws-controllers-k8s/apigateway-controller/pkg/util/patch"
21+
)
22+
23+
func updateIntegrationResponseInput(desired, latest *resource, input *svcsdk.UpdateIntegrationResponseInput, delta *compare.Delta) {
24+
latestSpec := latest.ko.Spec
25+
desiredSpec := desired.ko.Spec
26+
27+
var patchSet patch.Set
28+
if delta.DifferentAt("Spec.ContentHandling") {
29+
patchSet.Replace("/contentHandling", desiredSpec.ContentHandling)
30+
}
31+
if delta.DifferentAt("Spec.ResponseParameters") {
32+
patchSet.ForMap("/responseParameters", latestSpec.ResponseParameters, desiredSpec.ResponseParameters, true)
33+
}
34+
if delta.DifferentAt("Spec.ResponseTemplates") {
35+
patchSet.ForMap("/responseTemplates", latestSpec.ResponseTemplates, desiredSpec.ResponseTemplates, true)
36+
}
37+
if delta.DifferentAt("Spec.SelectionPattern") {
38+
patchSet.Replace("/selectionPattern", desiredSpec.SelectionPattern)
39+
}
40+
41+
input.PatchOperations = patchSet.GetPatchOperations()
42+
}

pkg/resource/api_integration_response/resource.go

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)