Commit 062afeb
authored
Add new type to OperationConfig so user can implement CustomCheckRequiredFieldsMissingMethod (#112)
Issue #, if available:
[#850](aws-controllers-k8s/community#850)
Description of changes:
Adds new `pkg/generate/config.OperationConfig.CustomCheckRequiredFieldsMissingMethod `field of type *string so that user can implement a `CustomCheckRequiredFieldsMissingMethod` method as code-generator cannot handle certain cases.
ex. For the `SageMaker` resource `ModelPackage`. There are versioned `modelPackage` and unversioned `modelPackage`, they both have a different required field being `ModelPackageGroupName` and `ModelPackageName`. `requiredFieldsMissingFromReadOneInput` will by default auto-generate to check for `ModelPackageName` and will infinitely recreate since it will never find the required field when a user attempts to make a versioned `modelPackage` which is `modelPackageGroupName` as it does not contain a `ModelPackageName`. ModelPackage has one or the other for its required field but not both.
This new field allows the user to create their own custom implementation for `requiredFieldsMissingFromReadOneInput`, `requiredFieldsMissingFromSetAttributesInput`, and `requiredFieldsMissingFromGetAttributesInput`so that in cases where the auto-generated default required fields do not handle cases where it may be complicated ex: Have an exclusive-or of required fields.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.1 parent 1f3c922 commit 062afeb
File tree
5 files changed
+34
-3
lines changed- pkg
- generate/config
- model
- templates/pkg/resource
5 files changed
+34
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
510 | 528 | | |
511 | 529 | | |
512 | 530 | | |
| |||
560 | 578 | | |
561 | 579 | | |
562 | 580 | | |
563 | | - | |
| 581 | + | |
564 | 582 | | |
565 | 583 | | |
566 | 584 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
68 | 71 | | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
0 commit comments