/
Authorization__checks.go
47 lines (34 loc) · 1.1 KB
/
Authorization__checks.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//go:build !no_runtime_type_checking
package awsevents
import (
"fmt"
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
"github.com/aws/aws-cdk-go/awscdk/v2"
)
func validateAuthorization_ApiKeyParameters(apiKeyName *string, apiKeyValue awscdk.SecretValue) error {
if apiKeyName == nil {
return fmt.Errorf("parameter apiKeyName is required, but nil was provided")
}
if apiKeyValue == nil {
return fmt.Errorf("parameter apiKeyValue is required, but nil was provided")
}
return nil
}
func validateAuthorization_BasicParameters(username *string, password awscdk.SecretValue) error {
if username == nil {
return fmt.Errorf("parameter username is required, but nil was provided")
}
if password == nil {
return fmt.Errorf("parameter password is required, but nil was provided")
}
return nil
}
func validateAuthorization_OauthParameters(props *OAuthAuthorizationProps) error {
if props == nil {
return fmt.Errorf("parameter props is required, but nil was provided")
}
if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil {
return err
}
return nil
}