in awscdk/awssam/CfnFunction__checks.go [498:601]
func (j *jsiiProxy_CfnFunction) validateSetPoliciesParameters(val interface{}) error {
switch val.(type) {
case *string:
// ok
case string:
// ok
case awscdk.IResolvable:
// ok
case *CfnFunction_IAMPolicyDocumentProperty:
val := val.(*CfnFunction_IAMPolicyDocumentProperty)
if err := _jsii_.ValidateStruct(val, func() string { return "parameter val" }); err != nil {
return err
}
case CfnFunction_IAMPolicyDocumentProperty:
val_ := val.(CfnFunction_IAMPolicyDocumentProperty)
val := &val_
if err := _jsii_.ValidateStruct(val, func() string { return "parameter val" }); err != nil {
return err
}
case *[]interface{}:
val := val.(*[]interface{})
for idx_97dfc6, v := range *val {
switch v.(type) {
case *string:
// ok
case string:
// ok
case awscdk.IResolvable:
// ok
case *CfnFunction_IAMPolicyDocumentProperty:
v := v.(*CfnFunction_IAMPolicyDocumentProperty)
if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil {
return err
}
case CfnFunction_IAMPolicyDocumentProperty:
v_ := v.(CfnFunction_IAMPolicyDocumentProperty)
v := &v_
if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil {
return err
}
case *CfnFunction_SAMPolicyTemplateProperty:
v := v.(*CfnFunction_SAMPolicyTemplateProperty)
if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil {
return err
}
case CfnFunction_SAMPolicyTemplateProperty:
v_ := v.(CfnFunction_SAMPolicyTemplateProperty)
v := &v_
if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil {
return err
}
default:
if !_jsii_.IsAnonymousProxy(v) {
return fmt.Errorf("parameter val[%#v] must be one of the allowed types: *string, awscdk.IResolvable, *CfnFunction_IAMPolicyDocumentProperty, *CfnFunction_SAMPolicyTemplateProperty; received %#v (a %T)", idx_97dfc6, v, v)
}
}
}
case []interface{}:
val_ := val.([]interface{})
val := &val_
for idx_97dfc6, v := range *val {
switch v.(type) {
case *string:
// ok
case string:
// ok
case awscdk.IResolvable:
// ok
case *CfnFunction_IAMPolicyDocumentProperty:
v := v.(*CfnFunction_IAMPolicyDocumentProperty)
if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil {
return err
}
case CfnFunction_IAMPolicyDocumentProperty:
v_ := v.(CfnFunction_IAMPolicyDocumentProperty)
v := &v_
if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil {
return err
}
case *CfnFunction_SAMPolicyTemplateProperty:
v := v.(*CfnFunction_SAMPolicyTemplateProperty)
if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil {
return err
}
case CfnFunction_SAMPolicyTemplateProperty:
v_ := v.(CfnFunction_SAMPolicyTemplateProperty)
v := &v_
if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter val[%#v]", idx_97dfc6) }); err != nil {
return err
}
default:
if !_jsii_.IsAnonymousProxy(v) {
return fmt.Errorf("parameter val[%#v] must be one of the allowed types: *string, awscdk.IResolvable, *CfnFunction_IAMPolicyDocumentProperty, *CfnFunction_SAMPolicyTemplateProperty; received %#v (a %T)", idx_97dfc6, v, v)
}
}
}
default:
if !_jsii_.IsAnonymousProxy(val) {
return fmt.Errorf("parameter val must be one of the allowed types: *string, awscdk.IResolvable, *CfnFunction_IAMPolicyDocumentProperty, *[]interface{}; received %#v (a %T)", val, val)
}
}
return nil
}