Skip to content

Commit b5649cb

Browse files
committed
refacto schema
1 parent b5ebe2c commit b5649cb

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

cloudfoundry/resource_cf_route_service_binding.go

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,48 +26,32 @@ func resourceRouteServiceBinding() *schema.Resource {
2626
StateContext: resourceRouteServiceBindingImport,
2727
},
2828

29-
Schema: map[string]*schema.Schema{
30-
"service_instance": &schema.Schema{
31-
Type: schema.TypeString,
32-
Required: true,
33-
ForceNew: true,
34-
},
35-
"route": &schema.Schema{
36-
Type: schema.TypeString,
37-
Required: true,
38-
ForceNew: true,
39-
},
40-
"json_params": &schema.Schema{
41-
Type: schema.TypeString,
42-
Optional: true,
43-
ForceNew: true,
44-
},
45-
},
29+
Schema: resourceRouteServiceBindingSchema().Schema,
4630
SchemaVersion: 1,
4731
StateUpgraders: []schema.StateUpgrader{
4832
{
49-
Type: resourceRouteServiceBindingResourceV0().CoreConfigSchema().ImpliedType(),
33+
Type: resourceRouteServiceBindingSchema().CoreConfigSchema().ImpliedType(),
5034
Upgrade: upgradeStateRouteServiceBindingStateV0toV1ChangeID,
5135
Version: 0,
5236
},
5337
},
5438
}
5539
}
5640

57-
func resourceRouteServiceBindingResourceV0() *schema.Resource {
41+
func resourceRouteServiceBindingSchema() *schema.Resource {
5842
return &schema.Resource{
5943
Schema: map[string]*schema.Schema{
60-
"service_instance": &schema.Schema{
44+
"service_instance": {
6145
Type: schema.TypeString,
6246
Required: true,
6347
ForceNew: true,
6448
},
65-
"route": &schema.Schema{
49+
"route": {
6650
Type: schema.TypeString,
6751
Required: true,
6852
ForceNew: true,
6953
},
70-
"json_params": &schema.Schema{
54+
"json_params": {
7155
Type: schema.TypeString,
7256
Optional: true,
7357
ForceNew: true,

0 commit comments

Comments
 (0)