Remove the unnecessary use of &schema.Schema

This commit is contained in:
Alexander Hellbom 2016-10-24 16:43:53 +02:00
parent 4c45c790c3
commit 4b70654b57
8 changed files with 56 additions and 56 deletions

View File

@ -14,15 +14,15 @@ func dataSourcePagerDutyVendor() *schema.Resource {
Read: dataSourcePagerDutyVendorRead,
Schema: map[string]*schema.Schema{
"name_regex": &schema.Schema{
"name_regex": {
Type: schema.TypeString,
Required: true,
},
"name": &schema.Schema{
"name": {
Type: schema.TypeString,
Computed: true,
},
"type": &schema.Schema{
"type": {
Type: schema.TypeString,
Computed: true,
},

View File

@ -11,7 +11,7 @@ import (
func Provider() terraform.ResourceProvider {
return &schema.Provider{
Schema: map[string]*schema.Schema{
"token": &schema.Schema{
"token": {
Type: schema.TypeString,
Required: true,
DefaultFunc: schema.EnvDefaultFunc("PAGERDUTY_TOKEN", nil),

View File

@ -17,50 +17,50 @@ func resourcePagerDutyEscalationPolicy() *schema.Resource {
State: resourcePagerDutyEscalationPolicyImport,
},
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
},
"description": &schema.Schema{
"description": {
Type: schema.TypeString,
Optional: true,
Default: "Managed by Terraform",
},
"num_loops": &schema.Schema{
"num_loops": {
Type: schema.TypeInt,
Optional: true,
},
"teams": &schema.Schema{
"teams": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"rule": &schema.Schema{
"rule": {
Type: schema.TypeList,
Required: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": &schema.Schema{
"id": {
Type: schema.TypeString,
Computed: true,
},
"escalation_delay_in_minutes": &schema.Schema{
"escalation_delay_in_minutes": {
Type: schema.TypeInt,
Required: true,
},
"target": &schema.Schema{
"target": {
Type: schema.TypeList,
Required: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"type": &schema.Schema{
"type": {
Type: schema.TypeString,
Optional: true,
Default: "user_reference",
},
"id": &schema.Schema{
"id": {
Type: schema.TypeString,
Required: true,
},

View File

@ -17,35 +17,35 @@ func resourcePagerDutySchedule() *schema.Resource {
State: resourcePagerDutyScheduleImport,
},
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
"name": {
Type: schema.TypeString,
Optional: true,
},
"time_zone": &schema.Schema{
"time_zone": {
Type: schema.TypeString,
Required: true,
},
"description": &schema.Schema{
"description": {
Type: schema.TypeString,
Optional: true,
Default: "Managed by Terraform",
},
"layer": &schema.Schema{
"layer": {
Type: schema.TypeList,
Required: true,
ForceNew: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": &schema.Schema{
"id": {
Type: schema.TypeString,
Computed: true,
},
"name": &schema.Schema{
"name": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"start": &schema.Schema{
"start": {
Type: schema.TypeString,
Optional: true,
Computed: true,
@ -56,11 +56,11 @@ func resourcePagerDutySchedule() *schema.Resource {
return true
},
},
"end": &schema.Schema{
"end": {
Type: schema.TypeString,
Optional: true,
},
"rotation_virtual_start": &schema.Schema{
"rotation_virtual_start": {
Type: schema.TypeString,
Optional: true,
Computed: true,
@ -71,31 +71,31 @@ func resourcePagerDutySchedule() *schema.Resource {
return true
},
},
"rotation_turn_length_seconds": &schema.Schema{
"rotation_turn_length_seconds": {
Type: schema.TypeInt,
Required: true,
},
"users": &schema.Schema{
"users": {
Type: schema.TypeList,
Required: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"restriction": &schema.Schema{
"restriction": {
Optional: true,
Type: schema.TypeList,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"type": &schema.Schema{
"type": {
Type: schema.TypeString,
Required: true,
},
"start_time_of_day": &schema.Schema{
"start_time_of_day": {
Type: schema.TypeString,
Required: true,
},
"duration_seconds": &schema.Schema{
"duration_seconds": {
Type: schema.TypeInt,
Required: true,
},

View File

@ -17,36 +17,36 @@ func resourcePagerDutyService() *schema.Resource {
State: resourcePagerDutyServiceImport,
},
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
"name": {
Type: schema.TypeString,
Optional: true,
},
"description": &schema.Schema{
"description": {
Type: schema.TypeString,
Optional: true,
Default: "Managed by Terraform",
},
"auto_resolve_timeout": &schema.Schema{
"auto_resolve_timeout": {
Type: schema.TypeInt,
Optional: true,
},
"last_incident_timestamp": &schema.Schema{
"last_incident_timestamp": {
Type: schema.TypeString,
Computed: true,
},
"created_at": &schema.Schema{
"created_at": {
Type: schema.TypeString,
Computed: true,
},
"status": &schema.Schema{
"status": {
Type: schema.TypeString,
Computed: true,
},
"acknowledgement_timeout": &schema.Schema{
"acknowledgement_timeout": {
Type: schema.TypeInt,
Optional: true,
},
"escalation_policy": &schema.Schema{
"escalation_policy": {
Type: schema.TypeString,
Required: true,
},

View File

@ -16,15 +16,15 @@ func resourcePagerDutyServiceIntegration() *schema.Resource {
// Therefore it needs to be manually removed from the Web UI.
Delete: resourcePagerDutyServiceIntegrationDelete,
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
"name": {
Type: schema.TypeString,
Optional: true,
},
"service": &schema.Schema{
"service": {
Type: schema.TypeString,
Optional: true,
},
"type": &schema.Schema{
"type": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
@ -40,17 +40,17 @@ func resourcePagerDutyServiceIntegration() *schema.Resource {
"sql_monitor_inbound_integration",
}),
},
"vendor": &schema.Schema{
"vendor": {
Type: schema.TypeString,
ForceNew: true,
Optional: true,
},
"integration_key": &schema.Schema{
"integration_key": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"integration_email": &schema.Schema{
"integration_email": {
Type: schema.TypeString,
Optional: true,
Computed: true,

View File

@ -17,11 +17,11 @@ func resourcePagerDutyTeam() *schema.Resource {
State: resourcePagerDutyTeamImport,
},
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
},
"description": &schema.Schema{
"description": {
Type: schema.TypeString,
Optional: true,
Default: "Managed by Terraform",

View File

@ -17,20 +17,20 @@ func resourcePagerDutyUser() *schema.Resource {
State: resourcePagerDutyUserImport,
},
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
},
"email": &schema.Schema{
"email": {
Type: schema.TypeString,
Required: true,
},
"color": &schema.Schema{
"color": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"role": &schema.Schema{
"role": {
Type: schema.TypeString,
Optional: true,
Default: "user",
@ -42,15 +42,15 @@ func resourcePagerDutyUser() *schema.Resource {
"user",
}),
},
"job_title": &schema.Schema{
"job_title": {
Type: schema.TypeString,
Optional: true,
},
"avatar_url": &schema.Schema{
"avatar_url": {
Type: schema.TypeString,
Computed: true,
},
"teams": &schema.Schema{
"teams": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Schema{
@ -58,19 +58,19 @@ func resourcePagerDutyUser() *schema.Resource {
},
Set: schema.HashString,
},
"time_zone": &schema.Schema{
"time_zone": {
Type: schema.TypeString,
Computed: true,
},
"html_url": &schema.Schema{
"html_url": {
Type: schema.TypeString,
Computed: true,
},
"invitation_sent": &schema.Schema{
"invitation_sent": {
Type: schema.TypeBool,
Computed: true,
},
"description": &schema.Schema{
"description": {
Type: schema.TypeString,
Optional: true,
Default: "Managed by Terraform",