Skip to content

Commit f2723ab

Browse files
authored
Bug fixes for latest PCT core changes (#4)
1 parent 59b5b10 commit f2723ab

11 files changed

Lines changed: 138 additions & 122 deletions

plugin/provider.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ type Provider struct {
1717

1818
// Model maps the provider state as per schema.
1919
type ProviderModel struct {
20-
Host string `cty:"host"`
21-
Authorization string `cty:"authorization"`
20+
Host string `pctsdk:"host"`
21+
Authorization string `pctsdk:"authorization"`
2222
}
2323

2424
// Ensure the implementation satisfies the expected interfaces
@@ -47,7 +47,6 @@ func (p *Provider) Schema() *schema.ServiceResponse {
4747
Description: "URI for Airbyte API. May also be provided via AIRBYTE_HOST environment variable.",
4848
Required: true,
4949
},
50-
5150
"authorization": &schema.StringAttribute{
5251
Description: "Bearer Token for airbyte provider",
5352
Required: true,
@@ -72,7 +71,6 @@ func (p *Provider) Configure(req *schema.ServiceRequest) *schema.ServiceResponse
7271
if err != nil {
7372
return schema.ErrorResponse(err)
7473
}
75-
7674
if pm.Host == "" || pm.Authorization == "" {
7775
return schema.ErrorResponse(fmt.Errorf(
7876
"invalid host or credentials received.\n" +

plugin/source_amplitude_resource.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ type sourceAmplitudeResource struct {
1616
}
1717

1818
type sourceAmplitudeResourceModel struct {
19-
Name string `cty:"name"`
20-
SourceId string `cty:"source_id"`
21-
WorkspaceId string `cty:"workspace_id"`
22-
ConnectionConfiguration sourceAmplitudeConnConfigModel `cty:"configuration"`
19+
Name string `pctsdk:"name"`
20+
SourceId string `pctsdk:"source_id"`
21+
WorkspaceId string `pctsdk:"workspace_id"`
22+
ConnectionConfiguration sourceAmplitudeConnConfigModel `pctsdk:"configuration"`
2323
}
2424

2525
type sourceAmplitudeConnConfigModel struct {
26-
SourceType string `cty:"source_type"`
27-
StartDate string `cty:"start_date"`
28-
DataRegion string `cty:"data_region"`
29-
RequestTimeRange int `cty:"request_time_range"`
30-
ApiKey string `cty:"api_key"`
31-
SecretKey string `cty:"secret_key"`
26+
SourceType string `pctsdk:"source_type"`
27+
StartDate string `pctsdk:"start_date"`
28+
DataRegion string `pctsdk:"data_region"`
29+
RequestTimeRange int `pctsdk:"request_time_range"`
30+
ApiKey string `pctsdk:"api_key"`
31+
SecretKey string `pctsdk:"secret_key"`
3232
}
3333

3434
// Ensure the implementation satisfies the expected interfaces.
@@ -106,11 +106,13 @@ func (r *sourceAmplitudeResource) Schema() *schema.ServiceResponse {
106106
},
107107
"data_region": &schema.StringAttribute{
108108
Description: "Date Region",
109-
Required: false,
109+
Optional: true,
110+
Required: true,
110111
},
111112
"request_time_range": &schema.IntAttribute{
112113
Description: "Required time range",
113114
Optional: true,
115+
Required: true,
114116
},
115117
"secret_key": &schema.StringAttribute{
116118
Description: "Secret Key",

plugin/source_facebook_marketing_resource.go

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@ type sourceFacebookMarketingResource struct {
1616
}
1717

1818
type sourceFacebookMarketingResourceModel struct {
19-
Name string `cty:"name"`
20-
SourceId string `cty:"source_id"`
21-
WorkspaceId string `cty:"workspace_id"`
22-
ConnectionConfiguration sourceFacebookMarketingConnConfigModel `cty:"configuration"`
19+
Name string `pctsdk:"name"`
20+
SourceId string `pctsdk:"source_id"`
21+
WorkspaceId string `pctsdk:"workspace_id"`
22+
ConnectionConfiguration sourceFacebookMarketingConnConfigModel `pctsdk:"configuration"`
2323
}
2424

2525
type sourceFacebookMarketingConnConfigModel struct {
26-
SourceType string `cty:"source_type"`
27-
AccountId string `cty:"account_id"`
28-
StartDate string `cty:"start_date"`
29-
AccessToken string `cty:"access_token"`
30-
31-
EndDate string `cty:"end_date"`
32-
IncludeDeleted bool `cty:"include_deleted"`
33-
FetchThumbnailImages bool `cty:"fetch_thumbnail_images"`
34-
//CustomInsights any `cty:"custom_insights"`
35-
PageSize int `cty:"page_size"`
36-
InsightsLookbackWindow int `cty:"insights_lookback_window"`
37-
MaxBatchSize int `cty:"max_batch_size"`
38-
ActionBreakdownsAllowEmpty bool `cty:"action_breakdowns_allow_empty"`
26+
SourceType string `pctsdk:"source_type"`
27+
AccountId string `pctsdk:"account_id"`
28+
StartDate string `pctsdk:"start_date"`
29+
AccessToken string `pctsdk:"access_token"`
30+
31+
EndDate string `pctsdk:"end_date"`
32+
IncludeDeleted bool `pctsdk:"include_deleted"`
33+
FetchThumbnailImages bool `pctsdk:"fetch_thumbnail_images"`
34+
//CustomInsights any `pctsdk:"custom_insights"`
35+
PageSize int `pctsdk:"page_size"`
36+
InsightsLookbackWindow int `pctsdk:"insights_lookback_window"`
37+
MaxBatchSize int `pctsdk:"max_batch_size"`
38+
ActionBreakdownsAllowEmpty bool `pctsdk:"action_breakdowns_allow_empty"`
3939
}
4040

4141
// Ensure the implementation satisfies the expected interfaces.
@@ -100,7 +100,7 @@ func (r *sourceFacebookMarketingResource) Schema() *schema.ServiceResponse {
100100
},
101101
"configuration": &schema.MapAttribute{
102102
Description: "Connection configuration",
103-
// Required: true,
103+
Required: true,
104104
//Sensitive: true,
105105
Attributes: map[string]schema.Attribute{
106106
"source_type": &schema.StringAttribute{
@@ -123,30 +123,37 @@ func (r *sourceFacebookMarketingResource) Schema() *schema.ServiceResponse {
123123
"end_date": &schema.StringAttribute{
124124
Description: "end date",
125125
Optional: true,
126+
Required: true,
126127
},
127128
"include_deleted": &schema.BoolAttribute{
128129
Description: "Include Deleted",
129130
Optional: true,
131+
Required: true,
130132
},
131133
"fetch_thumbnail_images": &schema.BoolAttribute{
132134
Description: "Fetch Thumbnail Image",
133135
Optional: true,
136+
Required: true,
134137
},
135138
"page_size": &schema.IntAttribute{
136139
Description: "Page Size",
137140
Optional: true,
141+
Required: true,
138142
},
139143
"insights_lookback_window": &schema.IntAttribute{
140144
Description: "insights_lookback_window",
141145
Optional: true,
146+
Required: true,
142147
},
143148
"max_batch_size": &schema.IntAttribute{
144149
Description: "Max Batch Size",
145150
Optional: true,
151+
Required: true,
146152
},
147153
"action_breakdowns_allow_empty": &schema.BoolAttribute{
148154
Description: "Action Breakdowns Allow Empty",
149155
Optional: true,
156+
Required: true,
150157
},
151158
},
152159
},

plugin/source_freshdesk_resource.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ type sourceFreshdeskResource struct {
1616
}
1717

1818
type sourceFreshdeskResourceModel struct {
19-
Name string `cty:"name"`
20-
SourceId string `cty:"source_id"`
21-
WorkspaceId string `cty:"workspace_id"`
22-
ConnectionConfiguration sourceFreshdeskConnConfigModel `cty:"configuration"`
19+
Name string `pctsdk:"name"`
20+
SourceId string `pctsdk:"source_id"`
21+
WorkspaceId string `pctsdk:"workspace_id"`
22+
ConnectionConfiguration sourceFreshdeskConnConfigModel `pctsdk:"configuration"`
2323
}
2424

2525
type sourceFreshdeskConnConfigModel struct {
26-
SourceType string `cty:"source_type"`
27-
StartDate string `cty:"start_date"`
28-
Domain string `cty:"domain"`
29-
ApiKey string `cty:"api_key"`
30-
RequestsPerMinute int `cty:"requests_per_minute"`
26+
SourceType string `pctsdk:"source_type"`
27+
StartDate string `pctsdk:"start_date"`
28+
Domain string `pctsdk:"domain"`
29+
ApiKey string `pctsdk:"api_key"`
30+
RequestsPerMinute int `pctsdk:"requests_per_minute"`
3131
}
3232

3333
// Ensure the implementation satisfies the expected interfaces.
@@ -115,6 +115,7 @@ func (r *sourceFreshdeskResource) Schema() *schema.ServiceResponse {
115115
"requests_per_minute": &schema.IntAttribute{
116116
Description: "Requests Per Minute",
117117
Optional: true,
118+
Required: true,
118119
},
119120
},
120121
},

plugin/source_google_analytics_v4_resource.go

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ type sourceGoogleAnalyticsV4Resource struct {
1616
}
1717

1818
type sourceGoogleAnalyticsV4ResourceModel struct {
19-
Name string `cty:"name"`
20-
SourceId string `cty:"source_id"`
21-
WorkspaceId string `cty:"workspace_id"`
22-
ConnectionConfiguration sourceGoogleAnalyticsV4ConnConfigModel `cty:"configuration"`
19+
Name string `pctsdk:"name"`
20+
SourceId string `pctsdk:"source_id"`
21+
WorkspaceId string `pctsdk:"workspace_id"`
22+
ConnectionConfiguration sourceGoogleAnalyticsV4ConnConfigModel `pctsdk:"configuration"`
2323
}
2424

2525
type sourceGoogleAnalyticsV4ConnConfigModel struct {
26-
SourceType string `cty:"source_type"`
27-
StartDate string `cty:"start_date"`
28-
WindowInDays int `cty:"window_in_days"`
29-
ViewId string `cty:"view_id"`
30-
CustomReports string `cty:"custom_reports"`
31-
Credentials googleAnalyticsV4CredConfigModel `cty:"credentials"`
26+
SourceType string `pctsdk:"source_type"`
27+
StartDate string `pctsdk:"start_date"`
28+
WindowInDays int `pctsdk:"window_in_days"`
29+
ViewId string `pctsdk:"view_id"`
30+
CustomReports string `pctsdk:"custom_reports"`
31+
Credentials googleAnalyticsV4CredConfigModel `pctsdk:"credentials"`
3232
}
3333
type googleAnalyticsV4CredConfigModel struct {
34-
AuthType string `cty:"auth_type"`
35-
CredentialsJson string `cty:"credentials_json"`
34+
AuthType string `pctsdk:"auth_type"`
35+
CredentialsJson string `pctsdk:"credentials_json"`
3636
}
3737

3838
// Ensure the implementation satisfies the expected interfaces.
@@ -114,11 +114,13 @@ func (r *sourceGoogleAnalyticsV4Resource) Schema() *schema.ServiceResponse {
114114
},
115115
"window_in_days": &schema.IntAttribute{
116116
Description: "window in days",
117-
Required: false,
117+
Required: true,
118+
Optional: true,
118119
},
119120
"custom_reports": &schema.StringAttribute{
120121
Description: "custom reports",
121-
Required: false,
122+
Required: true,
123+
Optional: true,
122124
},
123125
"credentials": &schema.MapAttribute{
124126
Description: "credentials",

plugin/source_google_sheets_resource.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ type sourceGoogleSheetsResource struct {
1616
}
1717

1818
type sourceGoogleSheetsResourceModel struct {
19-
Name string `cty:"name"`
20-
SourceId string `cty:"source_id"`
21-
WorkspaceId string `cty:"workspace_id"`
22-
ConnectionConfiguration sourceGoogleSheetsConnConfigModel `cty:"configuration"`
19+
Name string `pctsdk:"name"`
20+
SourceId string `pctsdk:"source_id"`
21+
WorkspaceId string `pctsdk:"workspace_id"`
22+
ConnectionConfiguration sourceGoogleSheetsConnConfigModel `pctsdk:"configuration"`
2323
}
2424

2525
type sourceGoogleSheetsConnConfigModel struct {
26-
SourceType string `cty:"source_type"`
27-
RowBatchSize int `cty:"row_batch_size"`
28-
SpreadsheetId string `cty:"spreadsheet_id"`
29-
Credentials googleSheetsCredConfigModel `cty:"credentials"`
26+
SourceType string `pctsdk:"source_type"`
27+
RowBatchSize int `pctsdk:"row_batch_size"`
28+
SpreadsheetId string `pctsdk:"spreadsheet_id"`
29+
Credentials googleSheetsCredConfigModel `pctsdk:"credentials"`
3030
}
3131
type googleSheetsCredConfigModel struct {
32-
AuthType string `cty:"auth_type"`
33-
ServiceAccountInfo string `cty:"service_account_info"`
32+
AuthType string `pctsdk:"auth_type"`
33+
ServiceAccountInfo string `pctsdk:"service_account_info"`
3434
}
3535

3636
// Ensure the implementation satisfies the expected interfaces.
@@ -104,7 +104,8 @@ func (r *sourceGoogleSheetsResource) Schema() *schema.ServiceResponse {
104104
},
105105
"row_batch_size": &schema.IntAttribute{
106106
Description: "Row Batch Size",
107-
Required: false,
107+
Required: true,
108+
Optional: true,
108109
},
109110
"spreadsheet_id": &schema.StringAttribute{
110111
Description: "Spreadsheet Id",

plugin/source_hubspot_resource.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ type sourceHubspotResource struct {
1616
}
1717

1818
type sourceHubspotResourceModel struct {
19-
Name string `cty:"name"`
20-
SourceId string `cty:"source_id"`
21-
WorkspaceId string `cty:"workspace_id"`
22-
ConnectionConfiguration sourceHubspotConnConfigModel `cty:"configuration"`
19+
Name string `pctsdk:"name"`
20+
SourceId string `pctsdk:"source_id"`
21+
WorkspaceId string `pctsdk:"workspace_id"`
22+
ConnectionConfiguration sourceHubspotConnConfigModel `pctsdk:"configuration"`
2323
}
2424

2525
type sourceHubspotConnConfigModel struct {
26-
SourceType string `cty:"source_type"`
27-
StartDate string `cty:"start_date"`
28-
Credentials hubspotCredConfigModel `cty:"credentials"`
26+
SourceType string `pctsdk:"source_type"`
27+
StartDate string `pctsdk:"start_date"`
28+
Credentials hubspotCredConfigModel `pctsdk:"credentials"`
2929
}
3030

3131
type hubspotCredConfigModel struct {
32-
CredentialsTitle string `cty:"credentials_title"`
33-
AccessToken string `cty:"access_token"`
32+
CredentialsTitle string `pctsdk:"credentials_title"`
33+
AccessToken string `pctsdk:"access_token"`
3434
}
3535

3636
// Ensure the implementation satisfies the expected interfaces.
@@ -108,6 +108,7 @@ func (r *sourceHubspotResource) Schema() *schema.ServiceResponse {
108108
},
109109
"credentials": &schema.MapAttribute{
110110
Description: "credentials",
111+
Required: true,
111112
Attributes: map[string]schema.Attribute{
112113
"credentials_title": &schema.StringAttribute{
113114
Description: "credentials title",

plugin/source_pipedrive_resource.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ type sourcePipedriveResource struct {
1616
}
1717

1818
type sourcePipedriveResourceModel struct {
19-
Name string `cty:"name"`
20-
SourceId string `cty:"source_id"`
21-
WorkspaceId string `cty:"workspace_id"`
22-
Configuration sourcePipedriveConnConfigModel `cty:"configuration"`
19+
Name string `pctsdk:"name"`
20+
SourceId string `pctsdk:"source_id"`
21+
WorkspaceId string `pctsdk:"workspace_id"`
22+
Configuration sourcePipedriveConnConfigModel `pctsdk:"configuration"`
2323
}
2424

2525
type sourcePipedriveConnConfigModel struct {
26-
SourceType string `cty:"source_type"`
27-
ReplicationStartDate string `cty:"replication_start_date"`
28-
Authorization sourcePipedriveAuthConfigModel `cty:"authorization"`
26+
SourceType string `pctsdk:"source_type"`
27+
ReplicationStartDate string `pctsdk:"replication_start_date"`
28+
Authorization sourcePipedriveAuthConfigModel `pctsdk:"authorization"`
2929
}
3030

3131
type sourcePipedriveAuthConfigModel struct {
32-
AuthType string `cty:"auth_type"`
33-
ApiToken string `cty:"api_token"`
32+
AuthType string `pctsdk:"auth_type"`
33+
ApiToken string `pctsdk:"api_token"`
3434
}
3535

3636
// Ensure the implementation satisfies the expected interfaces.

0 commit comments

Comments
 (0)