/
identityplatform_tenant.go
93 lines (82 loc) · 3.68 KB
/
identityplatform_tenant.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// ----------------------------------------------------------------------------
//
// *** AUTO GENERATED CODE *** Type: MMv1 ***
//
// ----------------------------------------------------------------------------
//
// This file is automatically generated by Magic Modules and manual
// changes will be clobbered when the file is regenerated.
//
// Please read more about how to change this file in
// .github/CONTRIBUTING.md.
//
// ----------------------------------------------------------------------------
package google
import "reflect"
const IdentityPlatformTenantAssetType string = "identitytoolkit.googleapis.com/Tenant"
func resourceConverterIdentityPlatformTenant() ResourceConverter {
return ResourceConverter{
AssetType: IdentityPlatformTenantAssetType,
Convert: GetIdentityPlatformTenantCaiObject,
}
}
func GetIdentityPlatformTenantCaiObject(d TerraformResourceData, config *Config) ([]Asset, error) {
name, err := assetName(d, config, "//identitytoolkit.googleapis.com/projects/{{project}}/tenants/{{name}}")
if err != nil {
return []Asset{}, err
}
if obj, err := GetIdentityPlatformTenantApiObject(d, config); err == nil {
return []Asset{{
Name: name,
Type: IdentityPlatformTenantAssetType,
Resource: &AssetResource{
Version: "v2",
DiscoveryDocumentURI: "https://www.googleapis.com/discovery/v1/apis/identitytoolkit/v2/rest",
DiscoveryName: "Tenant",
Data: obj,
},
}}, nil
} else {
return []Asset{}, err
}
}
func GetIdentityPlatformTenantApiObject(d TerraformResourceData, config *Config) (map[string]interface{}, error) {
obj := make(map[string]interface{})
displayNameProp, err := expandIdentityPlatformTenantDisplayName(d.Get("display_name"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("display_name"); !isEmptyValue(reflect.ValueOf(displayNameProp)) && (ok || !reflect.DeepEqual(v, displayNameProp)) {
obj["displayName"] = displayNameProp
}
allowPasswordSignupProp, err := expandIdentityPlatformTenantAllowPasswordSignup(d.Get("allow_password_signup"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("allow_password_signup"); !isEmptyValue(reflect.ValueOf(allowPasswordSignupProp)) && (ok || !reflect.DeepEqual(v, allowPasswordSignupProp)) {
obj["allowPasswordSignup"] = allowPasswordSignupProp
}
enableEmailLinkSigninProp, err := expandIdentityPlatformTenantEnableEmailLinkSignin(d.Get("enable_email_link_signin"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("enable_email_link_signin"); !isEmptyValue(reflect.ValueOf(enableEmailLinkSigninProp)) && (ok || !reflect.DeepEqual(v, enableEmailLinkSigninProp)) {
obj["enableEmailLinkSignin"] = enableEmailLinkSigninProp
}
disableAuthProp, err := expandIdentityPlatformTenantDisableAuth(d.Get("disable_auth"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("disable_auth"); !isEmptyValue(reflect.ValueOf(disableAuthProp)) && (ok || !reflect.DeepEqual(v, disableAuthProp)) {
obj["disableAuth"] = disableAuthProp
}
return obj, nil
}
func expandIdentityPlatformTenantDisplayName(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}
func expandIdentityPlatformTenantAllowPasswordSignup(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}
func expandIdentityPlatformTenantEnableEmailLinkSignin(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}
func expandIdentityPlatformTenantDisableAuth(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}