diff --git a/README.md b/README.md index 8c26960c5..fbf7210d3 100755 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ terraform { required_providers { airbyte = { source = "airbytehq/airbyte" - version = "0.3.1" + version = "0.3.2" } } } diff --git a/docs/index.md b/docs/index.md index 9ab082148..200791cb6 100644 --- a/docs/index.md +++ b/docs/index.md @@ -17,7 +17,7 @@ terraform { required_providers { airbyte = { source = "airbytehq/airbyte" - version = "0.3.1" + version = "0.3.2" } } } diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index a9ec04316..fcb7ac4d2 100755 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -2,7 +2,7 @@ terraform { required_providers { airbyte = { source = "airbytehq/airbyte" - version = "0.3.1" + version = "0.3.2" } } } diff --git a/gen.yaml b/gen.yaml index 81e65c934..51de317e0 100755 --- a/gen.yaml +++ b/gen.yaml @@ -5,11 +5,11 @@ generation: telemetryEnabled: true features: terraform: - core: 2.83.0 + core: 2.83.1 globalSecurity: 2.81.1 - globalServerURLs: 2.81.1 + globalServerURLs: 2.82.0 includes: 2.81.1 terraform: - version: 0.3.1 + version: 0.3.2 author: airbytehq packageName: airbyte diff --git a/internal/provider/connection_data_source.go b/internal/provider/connection_data_source.go index a87ff0532..7786fd69e 100755 --- a/internal/provider/connection_data_source.go +++ b/internal/provider/connection_data_source.go @@ -239,6 +239,9 @@ func (r *ConnectionDataSource) Read(ctx context.Context, req datasource.ReadRequ res, err := r.client.Connections.GetConnection(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/connection_resource.go b/internal/provider/connection_resource.go index 494e48db6..d3b554799 100755 --- a/internal/provider/connection_resource.go +++ b/internal/provider/connection_resource.go @@ -316,6 +316,9 @@ func (r *ConnectionResource) Create(ctx context.Context, req resource.CreateRequ res, err := r.client.Connections.CreateConnection(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -361,6 +364,9 @@ func (r *ConnectionResource) Read(ctx context.Context, req resource.ReadRequest, res, err := r.client.Connections.GetConnection(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -397,6 +403,9 @@ func (r *ConnectionResource) Update(ctx context.Context, req resource.UpdateRequ res, err := r.client.Connections.PatchConnection(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -442,6 +451,9 @@ func (r *ConnectionResource) Delete(ctx context.Context, req resource.DeleteRequ res, err := r.client.Connections.DeleteConnection(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_amazonsqs_data_source.go b/internal/provider/destination_amazonsqs_data_source.go index e8d4802aa..cccac0260 100755 --- a/internal/provider/destination_amazonsqs_data_source.go +++ b/internal/provider/destination_amazonsqs_data_source.go @@ -178,6 +178,9 @@ func (r *DestinationAmazonSqsDataSource) Read(ctx context.Context, req datasourc res, err := r.client.Destinations.GetDestinationAmazonSqs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_amazonsqs_resource.go b/internal/provider/destination_amazonsqs_resource.go index d48a05ac3..a8a0528f8 100755 --- a/internal/provider/destination_amazonsqs_resource.go +++ b/internal/provider/destination_amazonsqs_resource.go @@ -192,6 +192,9 @@ func (r *DestinationAmazonSqsResource) Create(ctx context.Context, req resource. res, err := r.client.Destinations.CreateDestinationAmazonSqs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -237,6 +240,9 @@ func (r *DestinationAmazonSqsResource) Read(ctx context.Context, req resource.Re res, err := r.client.Destinations.GetDestinationAmazonSqs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -273,6 +279,9 @@ func (r *DestinationAmazonSqsResource) Update(ctx context.Context, req resource. res, err := r.client.Destinations.PutDestinationAmazonSqs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -290,6 +299,9 @@ func (r *DestinationAmazonSqsResource) Update(ctx context.Context, req resource. getResponse, err := r.client.Destinations.GetDestinationAmazonSqs(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -335,6 +347,9 @@ func (r *DestinationAmazonSqsResource) Delete(ctx context.Context, req resource. res, err := r.client.Destinations.DeleteDestinationAmazonSqs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_awsdatalake_data_source.go b/internal/provider/destination_awsdatalake_data_source.go index 84d6216dd..b7aec0a84 100755 --- a/internal/provider/destination_awsdatalake_data_source.go +++ b/internal/provider/destination_awsdatalake_data_source.go @@ -418,6 +418,9 @@ func (r *DestinationAwsDatalakeDataSource) Read(ctx context.Context, req datasou res, err := r.client.Destinations.GetDestinationAwsDatalake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_awsdatalake_resource.go b/internal/provider/destination_awsdatalake_resource.go index 6915fc89c..cc23d8a5c 100755 --- a/internal/provider/destination_awsdatalake_resource.go +++ b/internal/provider/destination_awsdatalake_resource.go @@ -432,6 +432,9 @@ func (r *DestinationAwsDatalakeResource) Create(ctx context.Context, req resourc res, err := r.client.Destinations.CreateDestinationAwsDatalake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -477,6 +480,9 @@ func (r *DestinationAwsDatalakeResource) Read(ctx context.Context, req resource. res, err := r.client.Destinations.GetDestinationAwsDatalake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -513,6 +519,9 @@ func (r *DestinationAwsDatalakeResource) Update(ctx context.Context, req resourc res, err := r.client.Destinations.PutDestinationAwsDatalake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -530,6 +539,9 @@ func (r *DestinationAwsDatalakeResource) Update(ctx context.Context, req resourc getResponse, err := r.client.Destinations.GetDestinationAwsDatalake(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -575,6 +587,9 @@ func (r *DestinationAwsDatalakeResource) Delete(ctx context.Context, req resourc res, err := r.client.Destinations.DeleteDestinationAwsDatalake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_azureblobstorage_data_source.go b/internal/provider/destination_azureblobstorage_data_source.go index 671fb6c2a..29f43bcf3 100755 --- a/internal/provider/destination_azureblobstorage_data_source.go +++ b/internal/provider/destination_azureblobstorage_data_source.go @@ -236,6 +236,9 @@ func (r *DestinationAzureBlobStorageDataSource) Read(ctx context.Context, req da res, err := r.client.Destinations.GetDestinationAzureBlobStorage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_azureblobstorage_resource.go b/internal/provider/destination_azureblobstorage_resource.go index bae8e99c1..7b729b647 100755 --- a/internal/provider/destination_azureblobstorage_resource.go +++ b/internal/provider/destination_azureblobstorage_resource.go @@ -250,6 +250,9 @@ func (r *DestinationAzureBlobStorageResource) Create(ctx context.Context, req re res, err := r.client.Destinations.CreateDestinationAzureBlobStorage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -295,6 +298,9 @@ func (r *DestinationAzureBlobStorageResource) Read(ctx context.Context, req reso res, err := r.client.Destinations.GetDestinationAzureBlobStorage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -331,6 +337,9 @@ func (r *DestinationAzureBlobStorageResource) Update(ctx context.Context, req re res, err := r.client.Destinations.PutDestinationAzureBlobStorage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -348,6 +357,9 @@ func (r *DestinationAzureBlobStorageResource) Update(ctx context.Context, req re getResponse, err := r.client.Destinations.GetDestinationAzureBlobStorage(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -393,6 +405,9 @@ func (r *DestinationAzureBlobStorageResource) Delete(ctx context.Context, req re res, err := r.client.Destinations.DeleteDestinationAzureBlobStorage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_bigquery_data_source.go b/internal/provider/destination_bigquery_data_source.go index 14bba67c1..341b86514 100755 --- a/internal/provider/destination_bigquery_data_source.go +++ b/internal/provider/destination_bigquery_data_source.go @@ -376,6 +376,9 @@ func (r *DestinationBigqueryDataSource) Read(ctx context.Context, req datasource res, err := r.client.Destinations.GetDestinationBigquery(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_bigquery_resource.go b/internal/provider/destination_bigquery_resource.go index 63119ac28..b22fdb712 100755 --- a/internal/provider/destination_bigquery_resource.go +++ b/internal/provider/destination_bigquery_resource.go @@ -390,6 +390,9 @@ func (r *DestinationBigqueryResource) Create(ctx context.Context, req resource.C res, err := r.client.Destinations.CreateDestinationBigquery(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -435,6 +438,9 @@ func (r *DestinationBigqueryResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Destinations.GetDestinationBigquery(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -471,6 +477,9 @@ func (r *DestinationBigqueryResource) Update(ctx context.Context, req resource.U res, err := r.client.Destinations.PutDestinationBigquery(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -488,6 +497,9 @@ func (r *DestinationBigqueryResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Destinations.GetDestinationBigquery(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -533,6 +545,9 @@ func (r *DestinationBigqueryResource) Delete(ctx context.Context, req resource.D res, err := r.client.Destinations.DeleteDestinationBigquery(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_bigquerydenormalized_data_source.go b/internal/provider/destination_bigquerydenormalized_data_source.go index 9c806cf78..bb544308b 100755 --- a/internal/provider/destination_bigquerydenormalized_data_source.go +++ b/internal/provider/destination_bigquerydenormalized_data_source.go @@ -365,6 +365,9 @@ func (r *DestinationBigqueryDenormalizedDataSource) Read(ctx context.Context, re res, err := r.client.Destinations.GetDestinationBigqueryDenormalized(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_bigquerydenormalized_resource.go b/internal/provider/destination_bigquerydenormalized_resource.go index 8c6c38647..683743329 100755 --- a/internal/provider/destination_bigquerydenormalized_resource.go +++ b/internal/provider/destination_bigquerydenormalized_resource.go @@ -379,6 +379,9 @@ func (r *DestinationBigqueryDenormalizedResource) Create(ctx context.Context, re res, err := r.client.Destinations.CreateDestinationBigqueryDenormalized(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -424,6 +427,9 @@ func (r *DestinationBigqueryDenormalizedResource) Read(ctx context.Context, req res, err := r.client.Destinations.GetDestinationBigqueryDenormalized(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -460,6 +466,9 @@ func (r *DestinationBigqueryDenormalizedResource) Update(ctx context.Context, re res, err := r.client.Destinations.PutDestinationBigqueryDenormalized(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -477,6 +486,9 @@ func (r *DestinationBigqueryDenormalizedResource) Update(ctx context.Context, re getResponse, err := r.client.Destinations.GetDestinationBigqueryDenormalized(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -522,6 +534,9 @@ func (r *DestinationBigqueryDenormalizedResource) Delete(ctx context.Context, re res, err := r.client.Destinations.DeleteDestinationBigqueryDenormalized(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_cassandra_data_source.go b/internal/provider/destination_cassandra_data_source.go index 76ffaf016..c8bcb908a 100755 --- a/internal/provider/destination_cassandra_data_source.go +++ b/internal/provider/destination_cassandra_data_source.go @@ -148,6 +148,9 @@ func (r *DestinationCassandraDataSource) Read(ctx context.Context, req datasourc res, err := r.client.Destinations.GetDestinationCassandra(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_cassandra_resource.go b/internal/provider/destination_cassandra_resource.go index 01262f9f1..cf57c9971 100755 --- a/internal/provider/destination_cassandra_resource.go +++ b/internal/provider/destination_cassandra_resource.go @@ -162,6 +162,9 @@ func (r *DestinationCassandraResource) Create(ctx context.Context, req resource. res, err := r.client.Destinations.CreateDestinationCassandra(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -207,6 +210,9 @@ func (r *DestinationCassandraResource) Read(ctx context.Context, req resource.Re res, err := r.client.Destinations.GetDestinationCassandra(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -243,6 +249,9 @@ func (r *DestinationCassandraResource) Update(ctx context.Context, req resource. res, err := r.client.Destinations.PutDestinationCassandra(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -260,6 +269,9 @@ func (r *DestinationCassandraResource) Update(ctx context.Context, req resource. getResponse, err := r.client.Destinations.GetDestinationCassandra(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -305,6 +317,9 @@ func (r *DestinationCassandraResource) Delete(ctx context.Context, req resource. res, err := r.client.Destinations.DeleteDestinationCassandra(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_clickhouse_data_source.go b/internal/provider/destination_clickhouse_data_source.go index 35fef5015..721a72aef 100755 --- a/internal/provider/destination_clickhouse_data_source.go +++ b/internal/provider/destination_clickhouse_data_source.go @@ -314,6 +314,9 @@ func (r *DestinationClickhouseDataSource) Read(ctx context.Context, req datasour res, err := r.client.Destinations.GetDestinationClickhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_clickhouse_resource.go b/internal/provider/destination_clickhouse_resource.go index e02fc4400..a7ffe79ce 100755 --- a/internal/provider/destination_clickhouse_resource.go +++ b/internal/provider/destination_clickhouse_resource.go @@ -328,6 +328,9 @@ func (r *DestinationClickhouseResource) Create(ctx context.Context, req resource res, err := r.client.Destinations.CreateDestinationClickhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -373,6 +376,9 @@ func (r *DestinationClickhouseResource) Read(ctx context.Context, req resource.R res, err := r.client.Destinations.GetDestinationClickhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -409,6 +415,9 @@ func (r *DestinationClickhouseResource) Update(ctx context.Context, req resource res, err := r.client.Destinations.PutDestinationClickhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -426,6 +435,9 @@ func (r *DestinationClickhouseResource) Update(ctx context.Context, req resource getResponse, err := r.client.Destinations.GetDestinationClickhouse(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -471,6 +483,9 @@ func (r *DestinationClickhouseResource) Delete(ctx context.Context, req resource res, err := r.client.Destinations.DeleteDestinationClickhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_convex_data_source.go b/internal/provider/destination_convex_data_source.go index 98d5d9e4a..9f7ce6936 100755 --- a/internal/provider/destination_convex_data_source.go +++ b/internal/provider/destination_convex_data_source.go @@ -128,6 +128,9 @@ func (r *DestinationConvexDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Destinations.GetDestinationConvex(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_convex_resource.go b/internal/provider/destination_convex_resource.go index 8e456b52a..86870e18e 100755 --- a/internal/provider/destination_convex_resource.go +++ b/internal/provider/destination_convex_resource.go @@ -142,6 +142,9 @@ func (r *DestinationConvexResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Destinations.CreateDestinationConvex(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -187,6 +190,9 @@ func (r *DestinationConvexResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Destinations.GetDestinationConvex(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -223,6 +229,9 @@ func (r *DestinationConvexResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Destinations.PutDestinationConvex(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +249,9 @@ func (r *DestinationConvexResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Destinations.GetDestinationConvex(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -285,6 +297,9 @@ func (r *DestinationConvexResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Destinations.DeleteDestinationConvex(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_cumulio_data_source.go b/internal/provider/destination_cumulio_data_source.go index 7eb15994b..7ac97a472 100755 --- a/internal/provider/destination_cumulio_data_source.go +++ b/internal/provider/destination_cumulio_data_source.go @@ -132,6 +132,9 @@ func (r *DestinationCumulioDataSource) Read(ctx context.Context, req datasource. res, err := r.client.Destinations.GetDestinationCumulio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_cumulio_resource.go b/internal/provider/destination_cumulio_resource.go index b8c6a1209..35aaef3fc 100755 --- a/internal/provider/destination_cumulio_resource.go +++ b/internal/provider/destination_cumulio_resource.go @@ -146,6 +146,9 @@ func (r *DestinationCumulioResource) Create(ctx context.Context, req resource.Cr res, err := r.client.Destinations.CreateDestinationCumulio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -191,6 +194,9 @@ func (r *DestinationCumulioResource) Read(ctx context.Context, req resource.Read res, err := r.client.Destinations.GetDestinationCumulio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -227,6 +233,9 @@ func (r *DestinationCumulioResource) Update(ctx context.Context, req resource.Up res, err := r.client.Destinations.PutDestinationCumulio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +253,9 @@ func (r *DestinationCumulioResource) Update(ctx context.Context, req resource.Up getResponse, err := r.client.Destinations.GetDestinationCumulio(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -289,6 +301,9 @@ func (r *DestinationCumulioResource) Delete(ctx context.Context, req resource.De res, err := r.client.Destinations.DeleteDestinationCumulio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_databend_data_source.go b/internal/provider/destination_databend_data_source.go index a6f06e7ea..f6a262ab2 100755 --- a/internal/provider/destination_databend_data_source.go +++ b/internal/provider/destination_databend_data_source.go @@ -144,6 +144,9 @@ func (r *DestinationDatabendDataSource) Read(ctx context.Context, req datasource res, err := r.client.Destinations.GetDestinationDatabend(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_databend_resource.go b/internal/provider/destination_databend_resource.go index e2d7817f1..2bfcb38b3 100755 --- a/internal/provider/destination_databend_resource.go +++ b/internal/provider/destination_databend_resource.go @@ -158,6 +158,9 @@ func (r *DestinationDatabendResource) Create(ctx context.Context, req resource.C res, err := r.client.Destinations.CreateDestinationDatabend(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -203,6 +206,9 @@ func (r *DestinationDatabendResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Destinations.GetDestinationDatabend(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -239,6 +245,9 @@ func (r *DestinationDatabendResource) Update(ctx context.Context, req resource.U res, err := r.client.Destinations.PutDestinationDatabend(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -256,6 +265,9 @@ func (r *DestinationDatabendResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Destinations.GetDestinationDatabend(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -301,6 +313,9 @@ func (r *DestinationDatabendResource) Delete(ctx context.Context, req resource.D res, err := r.client.Destinations.DeleteDestinationDatabend(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_databricks_data_source.go b/internal/provider/destination_databricks_data_source.go index f13e2fa0f..d12332c9b 100755 --- a/internal/provider/destination_databricks_data_source.go +++ b/internal/provider/destination_databricks_data_source.go @@ -394,6 +394,9 @@ func (r *DestinationDatabricksDataSource) Read(ctx context.Context, req datasour res, err := r.client.Destinations.GetDestinationDatabricks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_databricks_resource.go b/internal/provider/destination_databricks_resource.go index 06e63f65c..739b5251b 100755 --- a/internal/provider/destination_databricks_resource.go +++ b/internal/provider/destination_databricks_resource.go @@ -408,6 +408,9 @@ func (r *DestinationDatabricksResource) Create(ctx context.Context, req resource res, err := r.client.Destinations.CreateDestinationDatabricks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -453,6 +456,9 @@ func (r *DestinationDatabricksResource) Read(ctx context.Context, req resource.R res, err := r.client.Destinations.GetDestinationDatabricks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -489,6 +495,9 @@ func (r *DestinationDatabricksResource) Update(ctx context.Context, req resource res, err := r.client.Destinations.PutDestinationDatabricks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -506,6 +515,9 @@ func (r *DestinationDatabricksResource) Update(ctx context.Context, req resource getResponse, err := r.client.Destinations.GetDestinationDatabricks(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -551,6 +563,9 @@ func (r *DestinationDatabricksResource) Delete(ctx context.Context, req resource res, err := r.client.Destinations.DeleteDestinationDatabricks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_devnull_data_source.go b/internal/provider/destination_devnull_data_source.go index 8a0d4d163..55bf513ec 100755 --- a/internal/provider/destination_devnull_data_source.go +++ b/internal/provider/destination_devnull_data_source.go @@ -160,6 +160,9 @@ func (r *DestinationDevNullDataSource) Read(ctx context.Context, req datasource. res, err := r.client.Destinations.GetDestinationDevNull(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_devnull_resource.go b/internal/provider/destination_devnull_resource.go index 8385a9581..e0d25d31f 100755 --- a/internal/provider/destination_devnull_resource.go +++ b/internal/provider/destination_devnull_resource.go @@ -174,6 +174,9 @@ func (r *DestinationDevNullResource) Create(ctx context.Context, req resource.Cr res, err := r.client.Destinations.CreateDestinationDevNull(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -219,6 +222,9 @@ func (r *DestinationDevNullResource) Read(ctx context.Context, req resource.Read res, err := r.client.Destinations.GetDestinationDevNull(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -255,6 +261,9 @@ func (r *DestinationDevNullResource) Update(ctx context.Context, req resource.Up res, err := r.client.Destinations.PutDestinationDevNull(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -272,6 +281,9 @@ func (r *DestinationDevNullResource) Update(ctx context.Context, req resource.Up getResponse, err := r.client.Destinations.GetDestinationDevNull(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -317,6 +329,9 @@ func (r *DestinationDevNullResource) Delete(ctx context.Context, req resource.De res, err := r.client.Destinations.DeleteDestinationDevNull(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_dynamodb_data_source.go b/internal/provider/destination_dynamodb_data_source.go index 036b06813..4f4049bd5 100755 --- a/internal/provider/destination_dynamodb_data_source.go +++ b/internal/provider/destination_dynamodb_data_source.go @@ -171,6 +171,9 @@ func (r *DestinationDynamodbDataSource) Read(ctx context.Context, req datasource res, err := r.client.Destinations.GetDestinationDynamodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_dynamodb_resource.go b/internal/provider/destination_dynamodb_resource.go index 952dc6875..fd29c2201 100755 --- a/internal/provider/destination_dynamodb_resource.go +++ b/internal/provider/destination_dynamodb_resource.go @@ -185,6 +185,9 @@ func (r *DestinationDynamodbResource) Create(ctx context.Context, req resource.C res, err := r.client.Destinations.CreateDestinationDynamodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -230,6 +233,9 @@ func (r *DestinationDynamodbResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Destinations.GetDestinationDynamodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -266,6 +272,9 @@ func (r *DestinationDynamodbResource) Update(ctx context.Context, req resource.U res, err := r.client.Destinations.PutDestinationDynamodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -283,6 +292,9 @@ func (r *DestinationDynamodbResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Destinations.GetDestinationDynamodb(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -328,6 +340,9 @@ func (r *DestinationDynamodbResource) Delete(ctx context.Context, req resource.D res, err := r.client.Destinations.DeleteDestinationDynamodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_elasticsearch_data_source.go b/internal/provider/destination_elasticsearch_data_source.go index 29f61464b..2ef979c5f 100755 --- a/internal/provider/destination_elasticsearch_data_source.go +++ b/internal/provider/destination_elasticsearch_data_source.go @@ -234,6 +234,9 @@ func (r *DestinationElasticsearchDataSource) Read(ctx context.Context, req datas res, err := r.client.Destinations.GetDestinationElasticsearch(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_elasticsearch_resource.go b/internal/provider/destination_elasticsearch_resource.go index b83b9e146..8b8e7f296 100755 --- a/internal/provider/destination_elasticsearch_resource.go +++ b/internal/provider/destination_elasticsearch_resource.go @@ -248,6 +248,9 @@ func (r *DestinationElasticsearchResource) Create(ctx context.Context, req resou res, err := r.client.Destinations.CreateDestinationElasticsearch(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -293,6 +296,9 @@ func (r *DestinationElasticsearchResource) Read(ctx context.Context, req resourc res, err := r.client.Destinations.GetDestinationElasticsearch(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -329,6 +335,9 @@ func (r *DestinationElasticsearchResource) Update(ctx context.Context, req resou res, err := r.client.Destinations.PutDestinationElasticsearch(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -346,6 +355,9 @@ func (r *DestinationElasticsearchResource) Update(ctx context.Context, req resou getResponse, err := r.client.Destinations.GetDestinationElasticsearch(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -391,6 +403,9 @@ func (r *DestinationElasticsearchResource) Delete(ctx context.Context, req resou res, err := r.client.Destinations.DeleteDestinationElasticsearch(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_firebolt_data_source.go b/internal/provider/destination_firebolt_data_source.go index 795989b4b..9e2038fe4 100755 --- a/internal/provider/destination_firebolt_data_source.go +++ b/internal/provider/destination_firebolt_data_source.go @@ -246,6 +246,9 @@ func (r *DestinationFireboltDataSource) Read(ctx context.Context, req datasource res, err := r.client.Destinations.GetDestinationFirebolt(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_firebolt_resource.go b/internal/provider/destination_firebolt_resource.go index b491e400a..8de8fcc7c 100755 --- a/internal/provider/destination_firebolt_resource.go +++ b/internal/provider/destination_firebolt_resource.go @@ -260,6 +260,9 @@ func (r *DestinationFireboltResource) Create(ctx context.Context, req resource.C res, err := r.client.Destinations.CreateDestinationFirebolt(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -305,6 +308,9 @@ func (r *DestinationFireboltResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Destinations.GetDestinationFirebolt(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -341,6 +347,9 @@ func (r *DestinationFireboltResource) Update(ctx context.Context, req resource.U res, err := r.client.Destinations.PutDestinationFirebolt(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -358,6 +367,9 @@ func (r *DestinationFireboltResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Destinations.GetDestinationFirebolt(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -403,6 +415,9 @@ func (r *DestinationFireboltResource) Delete(ctx context.Context, req resource.D res, err := r.client.Destinations.DeleteDestinationFirebolt(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_firestore_data_source.go b/internal/provider/destination_firestore_data_source.go index 110b505ce..f097c9b38 100755 --- a/internal/provider/destination_firestore_data_source.go +++ b/internal/provider/destination_firestore_data_source.go @@ -128,6 +128,9 @@ func (r *DestinationFirestoreDataSource) Read(ctx context.Context, req datasourc res, err := r.client.Destinations.GetDestinationFirestore(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_firestore_resource.go b/internal/provider/destination_firestore_resource.go index ebc3286e9..b7eb8205b 100755 --- a/internal/provider/destination_firestore_resource.go +++ b/internal/provider/destination_firestore_resource.go @@ -142,6 +142,9 @@ func (r *DestinationFirestoreResource) Create(ctx context.Context, req resource. res, err := r.client.Destinations.CreateDestinationFirestore(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -187,6 +190,9 @@ func (r *DestinationFirestoreResource) Read(ctx context.Context, req resource.Re res, err := r.client.Destinations.GetDestinationFirestore(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -223,6 +229,9 @@ func (r *DestinationFirestoreResource) Update(ctx context.Context, req resource. res, err := r.client.Destinations.PutDestinationFirestore(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +249,9 @@ func (r *DestinationFirestoreResource) Update(ctx context.Context, req resource. getResponse, err := r.client.Destinations.GetDestinationFirestore(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -285,6 +297,9 @@ func (r *DestinationFirestoreResource) Delete(ctx context.Context, req resource. res, err := r.client.Destinations.DeleteDestinationFirestore(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_gcs_data_source.go b/internal/provider/destination_gcs_data_source.go index 2322725f2..76072f3e1 100755 --- a/internal/provider/destination_gcs_data_source.go +++ b/internal/provider/destination_gcs_data_source.go @@ -837,6 +837,9 @@ func (r *DestinationGcsDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Destinations.GetDestinationGcs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_gcs_resource.go b/internal/provider/destination_gcs_resource.go index b4d4c9572..ebd04caac 100755 --- a/internal/provider/destination_gcs_resource.go +++ b/internal/provider/destination_gcs_resource.go @@ -851,6 +851,9 @@ func (r *DestinationGcsResource) Create(ctx context.Context, req resource.Create res, err := r.client.Destinations.CreateDestinationGcs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -896,6 +899,9 @@ func (r *DestinationGcsResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Destinations.GetDestinationGcs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -932,6 +938,9 @@ func (r *DestinationGcsResource) Update(ctx context.Context, req resource.Update res, err := r.client.Destinations.PutDestinationGcs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -949,6 +958,9 @@ func (r *DestinationGcsResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Destinations.GetDestinationGcs(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -994,6 +1006,9 @@ func (r *DestinationGcsResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Destinations.DeleteDestinationGcs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_googlesheets_data_source.go b/internal/provider/destination_googlesheets_data_source.go index 1aeabad2e..d9219a9cf 100755 --- a/internal/provider/destination_googlesheets_data_source.go +++ b/internal/provider/destination_googlesheets_data_source.go @@ -142,6 +142,9 @@ func (r *DestinationGoogleSheetsDataSource) Read(ctx context.Context, req dataso res, err := r.client.Destinations.GetDestinationGoogleSheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_googlesheets_resource.go b/internal/provider/destination_googlesheets_resource.go index c41b8fcbe..81ff681c6 100755 --- a/internal/provider/destination_googlesheets_resource.go +++ b/internal/provider/destination_googlesheets_resource.go @@ -156,6 +156,9 @@ func (r *DestinationGoogleSheetsResource) Create(ctx context.Context, req resour res, err := r.client.Destinations.CreateDestinationGoogleSheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -201,6 +204,9 @@ func (r *DestinationGoogleSheetsResource) Read(ctx context.Context, req resource res, err := r.client.Destinations.GetDestinationGoogleSheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -237,6 +243,9 @@ func (r *DestinationGoogleSheetsResource) Update(ctx context.Context, req resour res, err := r.client.Destinations.PutDestinationGoogleSheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -254,6 +263,9 @@ func (r *DestinationGoogleSheetsResource) Update(ctx context.Context, req resour getResponse, err := r.client.Destinations.GetDestinationGoogleSheets(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -299,6 +311,9 @@ func (r *DestinationGoogleSheetsResource) Delete(ctx context.Context, req resour res, err := r.client.Destinations.DeleteDestinationGoogleSheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_keen_data_source.go b/internal/provider/destination_keen_data_source.go index 4ba920aeb..7d01313e1 100755 --- a/internal/provider/destination_keen_data_source.go +++ b/internal/provider/destination_keen_data_source.go @@ -132,6 +132,9 @@ func (r *DestinationKeenDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Destinations.GetDestinationKeen(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_keen_resource.go b/internal/provider/destination_keen_resource.go index a067d11a1..2169d9082 100755 --- a/internal/provider/destination_keen_resource.go +++ b/internal/provider/destination_keen_resource.go @@ -146,6 +146,9 @@ func (r *DestinationKeenResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Destinations.CreateDestinationKeen(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -191,6 +194,9 @@ func (r *DestinationKeenResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Destinations.GetDestinationKeen(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -227,6 +233,9 @@ func (r *DestinationKeenResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Destinations.PutDestinationKeen(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +253,9 @@ func (r *DestinationKeenResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Destinations.GetDestinationKeen(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -289,6 +301,9 @@ func (r *DestinationKeenResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Destinations.DeleteDestinationKeen(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_kinesis_data_source.go b/internal/provider/destination_kinesis_data_source.go index 4eeed15ba..f4d98b581 100755 --- a/internal/provider/destination_kinesis_data_source.go +++ b/internal/provider/destination_kinesis_data_source.go @@ -144,6 +144,9 @@ func (r *DestinationKinesisDataSource) Read(ctx context.Context, req datasource. res, err := r.client.Destinations.GetDestinationKinesis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_kinesis_resource.go b/internal/provider/destination_kinesis_resource.go index 167476d4f..abc0077b6 100755 --- a/internal/provider/destination_kinesis_resource.go +++ b/internal/provider/destination_kinesis_resource.go @@ -158,6 +158,9 @@ func (r *DestinationKinesisResource) Create(ctx context.Context, req resource.Cr res, err := r.client.Destinations.CreateDestinationKinesis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -203,6 +206,9 @@ func (r *DestinationKinesisResource) Read(ctx context.Context, req resource.Read res, err := r.client.Destinations.GetDestinationKinesis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -239,6 +245,9 @@ func (r *DestinationKinesisResource) Update(ctx context.Context, req resource.Up res, err := r.client.Destinations.PutDestinationKinesis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -256,6 +265,9 @@ func (r *DestinationKinesisResource) Update(ctx context.Context, req resource.Up getResponse, err := r.client.Destinations.GetDestinationKinesis(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -301,6 +313,9 @@ func (r *DestinationKinesisResource) Delete(ctx context.Context, req resource.De res, err := r.client.Destinations.DeleteDestinationKinesis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_mariadbcolumnstore_data_source.go b/internal/provider/destination_mariadbcolumnstore_data_source.go index 4879251cf..522e8bdf5 100755 --- a/internal/provider/destination_mariadbcolumnstore_data_source.go +++ b/internal/provider/destination_mariadbcolumnstore_data_source.go @@ -314,6 +314,9 @@ func (r *DestinationMariadbColumnstoreDataSource) Read(ctx context.Context, req res, err := r.client.Destinations.GetDestinationMariadbColumnstore(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_mariadbcolumnstore_resource.go b/internal/provider/destination_mariadbcolumnstore_resource.go index 950d06ce9..d67f2e8e8 100755 --- a/internal/provider/destination_mariadbcolumnstore_resource.go +++ b/internal/provider/destination_mariadbcolumnstore_resource.go @@ -328,6 +328,9 @@ func (r *DestinationMariadbColumnstoreResource) Create(ctx context.Context, req res, err := r.client.Destinations.CreateDestinationMariadbColumnstore(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -373,6 +376,9 @@ func (r *DestinationMariadbColumnstoreResource) Read(ctx context.Context, req re res, err := r.client.Destinations.GetDestinationMariadbColumnstore(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -409,6 +415,9 @@ func (r *DestinationMariadbColumnstoreResource) Update(ctx context.Context, req res, err := r.client.Destinations.PutDestinationMariadbColumnstore(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -426,6 +435,9 @@ func (r *DestinationMariadbColumnstoreResource) Update(ctx context.Context, req getResponse, err := r.client.Destinations.GetDestinationMariadbColumnstore(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -471,6 +483,9 @@ func (r *DestinationMariadbColumnstoreResource) Delete(ctx context.Context, req res, err := r.client.Destinations.DeleteDestinationMariadbColumnstore(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_meilisearch_data_source.go b/internal/provider/destination_meilisearch_data_source.go index 4701d89e7..f48175f01 100755 --- a/internal/provider/destination_meilisearch_data_source.go +++ b/internal/provider/destination_meilisearch_data_source.go @@ -128,6 +128,9 @@ func (r *DestinationMeilisearchDataSource) Read(ctx context.Context, req datasou res, err := r.client.Destinations.GetDestinationMeilisearch(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_meilisearch_resource.go b/internal/provider/destination_meilisearch_resource.go index 427995e78..e91fc50b5 100755 --- a/internal/provider/destination_meilisearch_resource.go +++ b/internal/provider/destination_meilisearch_resource.go @@ -142,6 +142,9 @@ func (r *DestinationMeilisearchResource) Create(ctx context.Context, req resourc res, err := r.client.Destinations.CreateDestinationMeilisearch(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -187,6 +190,9 @@ func (r *DestinationMeilisearchResource) Read(ctx context.Context, req resource. res, err := r.client.Destinations.GetDestinationMeilisearch(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -223,6 +229,9 @@ func (r *DestinationMeilisearchResource) Update(ctx context.Context, req resourc res, err := r.client.Destinations.PutDestinationMeilisearch(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +249,9 @@ func (r *DestinationMeilisearchResource) Update(ctx context.Context, req resourc getResponse, err := r.client.Destinations.GetDestinationMeilisearch(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -285,6 +297,9 @@ func (r *DestinationMeilisearchResource) Delete(ctx context.Context, req resourc res, err := r.client.Destinations.DeleteDestinationMeilisearch(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_mongodb_data_source.go b/internal/provider/destination_mongodb_data_source.go index f04bbd260..bd5f75f80 100755 --- a/internal/provider/destination_mongodb_data_source.go +++ b/internal/provider/destination_mongodb_data_source.go @@ -518,6 +518,9 @@ func (r *DestinationMongodbDataSource) Read(ctx context.Context, req datasource. res, err := r.client.Destinations.GetDestinationMongodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_mongodb_resource.go b/internal/provider/destination_mongodb_resource.go index c33da4445..1050f3983 100755 --- a/internal/provider/destination_mongodb_resource.go +++ b/internal/provider/destination_mongodb_resource.go @@ -532,6 +532,9 @@ func (r *DestinationMongodbResource) Create(ctx context.Context, req resource.Cr res, err := r.client.Destinations.CreateDestinationMongodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -577,6 +580,9 @@ func (r *DestinationMongodbResource) Read(ctx context.Context, req resource.Read res, err := r.client.Destinations.GetDestinationMongodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -613,6 +619,9 @@ func (r *DestinationMongodbResource) Update(ctx context.Context, req resource.Up res, err := r.client.Destinations.PutDestinationMongodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -630,6 +639,9 @@ func (r *DestinationMongodbResource) Update(ctx context.Context, req resource.Up getResponse, err := r.client.Destinations.GetDestinationMongodb(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -675,6 +687,9 @@ func (r *DestinationMongodbResource) Delete(ctx context.Context, req resource.De res, err := r.client.Destinations.DeleteDestinationMongodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_mssql_data_source.go b/internal/provider/destination_mssql_data_source.go index 5bd584957..f6bf10569 100755 --- a/internal/provider/destination_mssql_data_source.go +++ b/internal/provider/destination_mssql_data_source.go @@ -395,6 +395,9 @@ func (r *DestinationMssqlDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Destinations.GetDestinationMssql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_mssql_resource.go b/internal/provider/destination_mssql_resource.go index dd4a62268..27b465e82 100755 --- a/internal/provider/destination_mssql_resource.go +++ b/internal/provider/destination_mssql_resource.go @@ -409,6 +409,9 @@ func (r *DestinationMssqlResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Destinations.CreateDestinationMssql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -454,6 +457,9 @@ func (r *DestinationMssqlResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Destinations.GetDestinationMssql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -490,6 +496,9 @@ func (r *DestinationMssqlResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Destinations.PutDestinationMssql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -507,6 +516,9 @@ func (r *DestinationMssqlResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Destinations.GetDestinationMssql(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -552,6 +564,9 @@ func (r *DestinationMssqlResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Destinations.DeleteDestinationMssql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_mysql_data_source.go b/internal/provider/destination_mysql_data_source.go index 0b5359e87..6e6512227 100755 --- a/internal/provider/destination_mysql_data_source.go +++ b/internal/provider/destination_mysql_data_source.go @@ -314,6 +314,9 @@ func (r *DestinationMysqlDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Destinations.GetDestinationMysql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_mysql_resource.go b/internal/provider/destination_mysql_resource.go index c21cb0af4..61dd15aa8 100755 --- a/internal/provider/destination_mysql_resource.go +++ b/internal/provider/destination_mysql_resource.go @@ -328,6 +328,9 @@ func (r *DestinationMysqlResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Destinations.CreateDestinationMysql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -373,6 +376,9 @@ func (r *DestinationMysqlResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Destinations.GetDestinationMysql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -409,6 +415,9 @@ func (r *DestinationMysqlResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Destinations.PutDestinationMysql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -426,6 +435,9 @@ func (r *DestinationMysqlResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Destinations.GetDestinationMysql(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -471,6 +483,9 @@ func (r *DestinationMysqlResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Destinations.DeleteDestinationMysql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_oracle_data_source.go b/internal/provider/destination_oracle_data_source.go index 32863d4df..898bbf03e 100755 --- a/internal/provider/destination_oracle_data_source.go +++ b/internal/provider/destination_oracle_data_source.go @@ -318,6 +318,9 @@ func (r *DestinationOracleDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Destinations.GetDestinationOracle(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_oracle_resource.go b/internal/provider/destination_oracle_resource.go index 0d6ee9889..f038e47b2 100755 --- a/internal/provider/destination_oracle_resource.go +++ b/internal/provider/destination_oracle_resource.go @@ -332,6 +332,9 @@ func (r *DestinationOracleResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Destinations.CreateDestinationOracle(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -377,6 +380,9 @@ func (r *DestinationOracleResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Destinations.GetDestinationOracle(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -413,6 +419,9 @@ func (r *DestinationOracleResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Destinations.PutDestinationOracle(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -430,6 +439,9 @@ func (r *DestinationOracleResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Destinations.GetDestinationOracle(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -475,6 +487,9 @@ func (r *DestinationOracleResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Destinations.DeleteDestinationOracle(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_postgres_data_source.go b/internal/provider/destination_postgres_data_source.go index ebd69b377..11118d55a 100755 --- a/internal/provider/destination_postgres_data_source.go +++ b/internal/provider/destination_postgres_data_source.go @@ -562,6 +562,9 @@ func (r *DestinationPostgresDataSource) Read(ctx context.Context, req datasource res, err := r.client.Destinations.GetDestinationPostgres(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_postgres_resource.go b/internal/provider/destination_postgres_resource.go index 391d23940..b5fc5965d 100755 --- a/internal/provider/destination_postgres_resource.go +++ b/internal/provider/destination_postgres_resource.go @@ -576,6 +576,9 @@ func (r *DestinationPostgresResource) Create(ctx context.Context, req resource.C res, err := r.client.Destinations.CreateDestinationPostgres(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -621,6 +624,9 @@ func (r *DestinationPostgresResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Destinations.GetDestinationPostgres(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -657,6 +663,9 @@ func (r *DestinationPostgresResource) Update(ctx context.Context, req resource.U res, err := r.client.Destinations.PutDestinationPostgres(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -674,6 +683,9 @@ func (r *DestinationPostgresResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Destinations.GetDestinationPostgres(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -719,6 +731,9 @@ func (r *DestinationPostgresResource) Delete(ctx context.Context, req resource.D res, err := r.client.Destinations.DeleteDestinationPostgres(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_pubsub_data_source.go b/internal/provider/destination_pubsub_data_source.go index 635663ce4..239100c03 100755 --- a/internal/provider/destination_pubsub_data_source.go +++ b/internal/provider/destination_pubsub_data_source.go @@ -152,6 +152,9 @@ func (r *DestinationPubsubDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Destinations.GetDestinationPubsub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_pubsub_resource.go b/internal/provider/destination_pubsub_resource.go index 11cd685c0..66289ca8a 100755 --- a/internal/provider/destination_pubsub_resource.go +++ b/internal/provider/destination_pubsub_resource.go @@ -166,6 +166,9 @@ func (r *DestinationPubsubResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Destinations.CreateDestinationPubsub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -211,6 +214,9 @@ func (r *DestinationPubsubResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Destinations.GetDestinationPubsub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -247,6 +253,9 @@ func (r *DestinationPubsubResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Destinations.PutDestinationPubsub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -264,6 +273,9 @@ func (r *DestinationPubsubResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Destinations.GetDestinationPubsub(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -309,6 +321,9 @@ func (r *DestinationPubsubResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Destinations.DeleteDestinationPubsub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_pulsar_data_source.go b/internal/provider/destination_pulsar_data_source.go index 1fc3bef90..519d5f372 100755 --- a/internal/provider/destination_pulsar_data_source.go +++ b/internal/provider/destination_pulsar_data_source.go @@ -205,6 +205,9 @@ func (r *DestinationPulsarDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Destinations.GetDestinationPulsar(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_pulsar_resource.go b/internal/provider/destination_pulsar_resource.go index f7196d520..299398610 100755 --- a/internal/provider/destination_pulsar_resource.go +++ b/internal/provider/destination_pulsar_resource.go @@ -219,6 +219,9 @@ func (r *DestinationPulsarResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Destinations.CreateDestinationPulsar(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -264,6 +267,9 @@ func (r *DestinationPulsarResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Destinations.GetDestinationPulsar(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -300,6 +306,9 @@ func (r *DestinationPulsarResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Destinations.PutDestinationPulsar(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -317,6 +326,9 @@ func (r *DestinationPulsarResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Destinations.GetDestinationPulsar(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -362,6 +374,9 @@ func (r *DestinationPulsarResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Destinations.DeleteDestinationPulsar(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_rabbitmq_data_source.go b/internal/provider/destination_rabbitmq_data_source.go index dd725c3bf..84411d51b 100755 --- a/internal/provider/destination_rabbitmq_data_source.go +++ b/internal/provider/destination_rabbitmq_data_source.go @@ -152,6 +152,9 @@ func (r *DestinationRabbitmqDataSource) Read(ctx context.Context, req datasource res, err := r.client.Destinations.GetDestinationRabbitmq(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_rabbitmq_resource.go b/internal/provider/destination_rabbitmq_resource.go index ab3444955..ea03f721d 100755 --- a/internal/provider/destination_rabbitmq_resource.go +++ b/internal/provider/destination_rabbitmq_resource.go @@ -166,6 +166,9 @@ func (r *DestinationRabbitmqResource) Create(ctx context.Context, req resource.C res, err := r.client.Destinations.CreateDestinationRabbitmq(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -211,6 +214,9 @@ func (r *DestinationRabbitmqResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Destinations.GetDestinationRabbitmq(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -247,6 +253,9 @@ func (r *DestinationRabbitmqResource) Update(ctx context.Context, req resource.U res, err := r.client.Destinations.PutDestinationRabbitmq(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -264,6 +273,9 @@ func (r *DestinationRabbitmqResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Destinations.GetDestinationRabbitmq(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -309,6 +321,9 @@ func (r *DestinationRabbitmqResource) Delete(ctx context.Context, req resource.D res, err := r.client.Destinations.DeleteDestinationRabbitmq(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_redis_data_source.go b/internal/provider/destination_redis_data_source.go index 2dfcd6c88..ced2eea1c 100755 --- a/internal/provider/destination_redis_data_source.go +++ b/internal/provider/destination_redis_data_source.go @@ -422,6 +422,9 @@ func (r *DestinationRedisDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Destinations.GetDestinationRedis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_redis_resource.go b/internal/provider/destination_redis_resource.go index 67b469ecf..6ef53e3c9 100755 --- a/internal/provider/destination_redis_resource.go +++ b/internal/provider/destination_redis_resource.go @@ -436,6 +436,9 @@ func (r *DestinationRedisResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Destinations.CreateDestinationRedis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -481,6 +484,9 @@ func (r *DestinationRedisResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Destinations.GetDestinationRedis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -517,6 +523,9 @@ func (r *DestinationRedisResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Destinations.PutDestinationRedis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -534,6 +543,9 @@ func (r *DestinationRedisResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Destinations.GetDestinationRedis(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -579,6 +591,9 @@ func (r *DestinationRedisResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Destinations.DeleteDestinationRedis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_redshift_data_source.go b/internal/provider/destination_redshift_data_source.go index b03aa372c..5933025db 100755 --- a/internal/provider/destination_redshift_data_source.go +++ b/internal/provider/destination_redshift_data_source.go @@ -595,6 +595,9 @@ func (r *DestinationRedshiftDataSource) Read(ctx context.Context, req datasource res, err := r.client.Destinations.GetDestinationRedshift(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_redshift_resource.go b/internal/provider/destination_redshift_resource.go index 5fe4e5ee0..484b79f36 100755 --- a/internal/provider/destination_redshift_resource.go +++ b/internal/provider/destination_redshift_resource.go @@ -609,6 +609,9 @@ func (r *DestinationRedshiftResource) Create(ctx context.Context, req resource.C res, err := r.client.Destinations.CreateDestinationRedshift(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -654,6 +657,9 @@ func (r *DestinationRedshiftResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Destinations.GetDestinationRedshift(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -690,6 +696,9 @@ func (r *DestinationRedshiftResource) Update(ctx context.Context, req resource.U res, err := r.client.Destinations.PutDestinationRedshift(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -707,6 +716,9 @@ func (r *DestinationRedshiftResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Destinations.GetDestinationRedshift(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -752,6 +764,9 @@ func (r *DestinationRedshiftResource) Delete(ctx context.Context, req resource.D res, err := r.client.Destinations.DeleteDestinationRedshift(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_rockset_data_source.go b/internal/provider/destination_rockset_data_source.go index 4028a0a48..2b36dfde8 100755 --- a/internal/provider/destination_rockset_data_source.go +++ b/internal/provider/destination_rockset_data_source.go @@ -132,6 +132,9 @@ func (r *DestinationRocksetDataSource) Read(ctx context.Context, req datasource. res, err := r.client.Destinations.GetDestinationRockset(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_rockset_resource.go b/internal/provider/destination_rockset_resource.go index ccee2c87d..949f920e5 100755 --- a/internal/provider/destination_rockset_resource.go +++ b/internal/provider/destination_rockset_resource.go @@ -146,6 +146,9 @@ func (r *DestinationRocksetResource) Create(ctx context.Context, req resource.Cr res, err := r.client.Destinations.CreateDestinationRockset(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -191,6 +194,9 @@ func (r *DestinationRocksetResource) Read(ctx context.Context, req resource.Read res, err := r.client.Destinations.GetDestinationRockset(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -227,6 +233,9 @@ func (r *DestinationRocksetResource) Update(ctx context.Context, req resource.Up res, err := r.client.Destinations.PutDestinationRockset(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +253,9 @@ func (r *DestinationRocksetResource) Update(ctx context.Context, req resource.Up getResponse, err := r.client.Destinations.GetDestinationRockset(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -289,6 +301,9 @@ func (r *DestinationRocksetResource) Delete(ctx context.Context, req resource.De res, err := r.client.Destinations.DeleteDestinationRockset(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_s3_data_source.go b/internal/provider/destination_s3_data_source.go index d5d9ddde6..250628054 100755 --- a/internal/provider/destination_s3_data_source.go +++ b/internal/provider/destination_s3_data_source.go @@ -815,6 +815,9 @@ func (r *DestinationS3DataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Destinations.GetDestinationS3(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_s3_resource.go b/internal/provider/destination_s3_resource.go index 6e876f586..f9a92127e 100755 --- a/internal/provider/destination_s3_resource.go +++ b/internal/provider/destination_s3_resource.go @@ -829,6 +829,9 @@ func (r *DestinationS3Resource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Destinations.CreateDestinationS3(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -874,6 +877,9 @@ func (r *DestinationS3Resource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Destinations.GetDestinationS3(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -910,6 +916,9 @@ func (r *DestinationS3Resource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Destinations.PutDestinationS3(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -927,6 +936,9 @@ func (r *DestinationS3Resource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Destinations.GetDestinationS3(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -972,6 +984,9 @@ func (r *DestinationS3Resource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Destinations.DeleteDestinationS3(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_s3glue_data_source.go b/internal/provider/destination_s3glue_data_source.go index 42e01ef1c..c001567ad 100755 --- a/internal/provider/destination_s3glue_data_source.go +++ b/internal/provider/destination_s3glue_data_source.go @@ -338,6 +338,9 @@ func (r *DestinationS3GlueDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Destinations.GetDestinationS3Glue(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_s3glue_resource.go b/internal/provider/destination_s3glue_resource.go index 751e81f73..8f1e81621 100755 --- a/internal/provider/destination_s3glue_resource.go +++ b/internal/provider/destination_s3glue_resource.go @@ -352,6 +352,9 @@ func (r *DestinationS3GlueResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Destinations.CreateDestinationS3Glue(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -397,6 +400,9 @@ func (r *DestinationS3GlueResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Destinations.GetDestinationS3Glue(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -433,6 +439,9 @@ func (r *DestinationS3GlueResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Destinations.PutDestinationS3Glue(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -450,6 +459,9 @@ func (r *DestinationS3GlueResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Destinations.GetDestinationS3Glue(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -495,6 +507,9 @@ func (r *DestinationS3GlueResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Destinations.DeleteDestinationS3Glue(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_scylla_data_source.go b/internal/provider/destination_scylla_data_source.go index 0da04058b..9cf219692 100755 --- a/internal/provider/destination_scylla_data_source.go +++ b/internal/provider/destination_scylla_data_source.go @@ -144,6 +144,9 @@ func (r *DestinationScyllaDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Destinations.GetDestinationScylla(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_scylla_resource.go b/internal/provider/destination_scylla_resource.go index a0af4e229..a13e16452 100755 --- a/internal/provider/destination_scylla_resource.go +++ b/internal/provider/destination_scylla_resource.go @@ -158,6 +158,9 @@ func (r *DestinationScyllaResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Destinations.CreateDestinationScylla(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -203,6 +206,9 @@ func (r *DestinationScyllaResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Destinations.GetDestinationScylla(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -239,6 +245,9 @@ func (r *DestinationScyllaResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Destinations.PutDestinationScylla(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -256,6 +265,9 @@ func (r *DestinationScyllaResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Destinations.GetDestinationScylla(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -301,6 +313,9 @@ func (r *DestinationScyllaResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Destinations.DeleteDestinationScylla(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_sftpjson_data_source.go b/internal/provider/destination_sftpjson_data_source.go index 3ade46ff4..57975c172 100755 --- a/internal/provider/destination_sftpjson_data_source.go +++ b/internal/provider/destination_sftpjson_data_source.go @@ -140,6 +140,9 @@ func (r *DestinationSftpJSONDataSource) Read(ctx context.Context, req datasource res, err := r.client.Destinations.GetDestinationSftpJSON(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_sftpjson_resource.go b/internal/provider/destination_sftpjson_resource.go index 8bfb29136..d9af2bc12 100755 --- a/internal/provider/destination_sftpjson_resource.go +++ b/internal/provider/destination_sftpjson_resource.go @@ -154,6 +154,9 @@ func (r *DestinationSftpJSONResource) Create(ctx context.Context, req resource.C res, err := r.client.Destinations.CreateDestinationSftpJSON(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -199,6 +202,9 @@ func (r *DestinationSftpJSONResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Destinations.GetDestinationSftpJSON(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -235,6 +241,9 @@ func (r *DestinationSftpJSONResource) Update(ctx context.Context, req resource.U res, err := r.client.Destinations.PutDestinationSftpJSON(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -252,6 +261,9 @@ func (r *DestinationSftpJSONResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Destinations.GetDestinationSftpJSON(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -297,6 +309,9 @@ func (r *DestinationSftpJSONResource) Delete(ctx context.Context, req resource.D res, err := r.client.Destinations.DeleteDestinationSftpJSON(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_snowflake_data_source.go b/internal/provider/destination_snowflake_data_source.go index f81a2a9d3..c720a2929 100755 --- a/internal/provider/destination_snowflake_data_source.go +++ b/internal/provider/destination_snowflake_data_source.go @@ -646,6 +646,9 @@ func (r *DestinationSnowflakeDataSource) Read(ctx context.Context, req datasourc res, err := r.client.Destinations.GetDestinationSnowflake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_snowflake_resource.go b/internal/provider/destination_snowflake_resource.go index 91527afbf..17c87e7cb 100755 --- a/internal/provider/destination_snowflake_resource.go +++ b/internal/provider/destination_snowflake_resource.go @@ -660,6 +660,9 @@ func (r *DestinationSnowflakeResource) Create(ctx context.Context, req resource. res, err := r.client.Destinations.CreateDestinationSnowflake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -705,6 +708,9 @@ func (r *DestinationSnowflakeResource) Read(ctx context.Context, req resource.Re res, err := r.client.Destinations.GetDestinationSnowflake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -741,6 +747,9 @@ func (r *DestinationSnowflakeResource) Update(ctx context.Context, req resource. res, err := r.client.Destinations.PutDestinationSnowflake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -758,6 +767,9 @@ func (r *DestinationSnowflakeResource) Update(ctx context.Context, req resource. getResponse, err := r.client.Destinations.GetDestinationSnowflake(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -803,6 +815,9 @@ func (r *DestinationSnowflakeResource) Delete(ctx context.Context, req resource. res, err := r.client.Destinations.DeleteDestinationSnowflake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_typesense_data_source.go b/internal/provider/destination_typesense_data_source.go index 218d6d9f7..2320fe206 100755 --- a/internal/provider/destination_typesense_data_source.go +++ b/internal/provider/destination_typesense_data_source.go @@ -140,6 +140,9 @@ func (r *DestinationTypesenseDataSource) Read(ctx context.Context, req datasourc res, err := r.client.Destinations.GetDestinationTypesense(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_typesense_resource.go b/internal/provider/destination_typesense_resource.go index 333505245..1d4d9cefd 100755 --- a/internal/provider/destination_typesense_resource.go +++ b/internal/provider/destination_typesense_resource.go @@ -154,6 +154,9 @@ func (r *DestinationTypesenseResource) Create(ctx context.Context, req resource. res, err := r.client.Destinations.CreateDestinationTypesense(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -199,6 +202,9 @@ func (r *DestinationTypesenseResource) Read(ctx context.Context, req resource.Re res, err := r.client.Destinations.GetDestinationTypesense(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -235,6 +241,9 @@ func (r *DestinationTypesenseResource) Update(ctx context.Context, req resource. res, err := r.client.Destinations.PutDestinationTypesense(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -252,6 +261,9 @@ func (r *DestinationTypesenseResource) Update(ctx context.Context, req resource. getResponse, err := r.client.Destinations.GetDestinationTypesense(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -297,6 +309,9 @@ func (r *DestinationTypesenseResource) Delete(ctx context.Context, req resource. res, err := r.client.Destinations.DeleteDestinationTypesense(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_vertica_data_source.go b/internal/provider/destination_vertica_data_source.go index 845ade8f3..bfc51846f 100755 --- a/internal/provider/destination_vertica_data_source.go +++ b/internal/provider/destination_vertica_data_source.go @@ -318,6 +318,9 @@ func (r *DestinationVerticaDataSource) Read(ctx context.Context, req datasource. res, err := r.client.Destinations.GetDestinationVertica(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/destination_vertica_resource.go b/internal/provider/destination_vertica_resource.go index 351e6200d..b90ca58f5 100755 --- a/internal/provider/destination_vertica_resource.go +++ b/internal/provider/destination_vertica_resource.go @@ -332,6 +332,9 @@ func (r *DestinationVerticaResource) Create(ctx context.Context, req resource.Cr res, err := r.client.Destinations.CreateDestinationVertica(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -377,6 +380,9 @@ func (r *DestinationVerticaResource) Read(ctx context.Context, req resource.Read res, err := r.client.Destinations.GetDestinationVertica(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -413,6 +419,9 @@ func (r *DestinationVerticaResource) Update(ctx context.Context, req resource.Up res, err := r.client.Destinations.PutDestinationVertica(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -430,6 +439,9 @@ func (r *DestinationVerticaResource) Update(ctx context.Context, req resource.Up getResponse, err := r.client.Destinations.GetDestinationVertica(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -475,6 +487,9 @@ func (r *DestinationVerticaResource) Delete(ctx context.Context, req resource.De res, err := r.client.Destinations.DeleteDestinationVertica(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_aircall_data_source.go b/internal/provider/source_aircall_data_source.go index 493569861..3bc929f99 100755 --- a/internal/provider/source_aircall_data_source.go +++ b/internal/provider/source_aircall_data_source.go @@ -141,6 +141,9 @@ func (r *SourceAircallDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceAircall(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_aircall_resource.go b/internal/provider/source_aircall_resource.go index 9c0f330d3..d533de527 100755 --- a/internal/provider/source_aircall_resource.go +++ b/internal/provider/source_aircall_resource.go @@ -155,6 +155,9 @@ func (r *SourceAircallResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceAircall(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -200,6 +203,9 @@ func (r *SourceAircallResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceAircall(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -236,6 +242,9 @@ func (r *SourceAircallResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceAircall(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +262,9 @@ func (r *SourceAircallResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceAircall(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -298,6 +310,9 @@ func (r *SourceAircallResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceAircall(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_airtable_data_source.go b/internal/provider/source_airtable_data_source.go index 2faa16b44..30b1b2f16 100755 --- a/internal/provider/source_airtable_data_source.go +++ b/internal/provider/source_airtable_data_source.go @@ -244,6 +244,9 @@ func (r *SourceAirtableDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceAirtable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_airtable_resource.go b/internal/provider/source_airtable_resource.go index c733617f5..d53805b3c 100755 --- a/internal/provider/source_airtable_resource.go +++ b/internal/provider/source_airtable_resource.go @@ -258,6 +258,9 @@ func (r *SourceAirtableResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceAirtable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -303,6 +306,9 @@ func (r *SourceAirtableResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceAirtable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -339,6 +345,9 @@ func (r *SourceAirtableResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceAirtable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -356,6 +365,9 @@ func (r *SourceAirtableResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceAirtable(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -401,6 +413,9 @@ func (r *SourceAirtableResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceAirtable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_alloydb_data_source.go b/internal/provider/source_alloydb_data_source.go index 8d104d2cc..714a01364 100755 --- a/internal/provider/source_alloydb_data_source.go +++ b/internal/provider/source_alloydb_data_source.go @@ -811,6 +811,9 @@ func (r *SourceAlloydbDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceAlloydb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_alloydb_resource.go b/internal/provider/source_alloydb_resource.go index b96036b4b..c04698391 100755 --- a/internal/provider/source_alloydb_resource.go +++ b/internal/provider/source_alloydb_resource.go @@ -825,6 +825,9 @@ func (r *SourceAlloydbResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceAlloydb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -870,6 +873,9 @@ func (r *SourceAlloydbResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceAlloydb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -906,6 +912,9 @@ func (r *SourceAlloydbResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceAlloydb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -923,6 +932,9 @@ func (r *SourceAlloydbResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceAlloydb(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -968,6 +980,9 @@ func (r *SourceAlloydbResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceAlloydb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_amazonads_data_source.go b/internal/provider/source_amazonads_data_source.go index 9ff19a01a..7024069ec 100755 --- a/internal/provider/source_amazonads_data_source.go +++ b/internal/provider/source_amazonads_data_source.go @@ -181,6 +181,9 @@ func (r *SourceAmazonAdsDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceAmazonAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_amazonads_resource.go b/internal/provider/source_amazonads_resource.go index ec58df2f4..5da3af310 100755 --- a/internal/provider/source_amazonads_resource.go +++ b/internal/provider/source_amazonads_resource.go @@ -195,6 +195,9 @@ func (r *SourceAmazonAdsResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceAmazonAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +243,9 @@ func (r *SourceAmazonAdsResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceAmazonAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -276,6 +282,9 @@ func (r *SourceAmazonAdsResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceAmazonAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -293,6 +302,9 @@ func (r *SourceAmazonAdsResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceAmazonAds(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -338,6 +350,9 @@ func (r *SourceAmazonAdsResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceAmazonAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_amazonsqs_data_source.go b/internal/provider/source_amazonsqs_data_source.go index a21dfd686..db965566c 100755 --- a/internal/provider/source_amazonsqs_data_source.go +++ b/internal/provider/source_amazonsqs_data_source.go @@ -191,6 +191,9 @@ func (r *SourceAmazonSqsDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceAmazonSqs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_amazonsqs_resource.go b/internal/provider/source_amazonsqs_resource.go index e2140a8df..cd955c08f 100755 --- a/internal/provider/source_amazonsqs_resource.go +++ b/internal/provider/source_amazonsqs_resource.go @@ -205,6 +205,9 @@ func (r *SourceAmazonSqsResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceAmazonSqs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -250,6 +253,9 @@ func (r *SourceAmazonSqsResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceAmazonSqs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -286,6 +292,9 @@ func (r *SourceAmazonSqsResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceAmazonSqs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -303,6 +312,9 @@ func (r *SourceAmazonSqsResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceAmazonSqs(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -348,6 +360,9 @@ func (r *SourceAmazonSqsResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceAmazonSqs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_amplitude_data_source.go b/internal/provider/source_amplitude_data_source.go index 1373f60ee..b51db4eab 100755 --- a/internal/provider/source_amplitude_data_source.go +++ b/internal/provider/source_amplitude_data_source.go @@ -152,6 +152,9 @@ func (r *SourceAmplitudeDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceAmplitude(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_amplitude_resource.go b/internal/provider/source_amplitude_resource.go index 151089d7b..f5ee84b63 100755 --- a/internal/provider/source_amplitude_resource.go +++ b/internal/provider/source_amplitude_resource.go @@ -166,6 +166,9 @@ func (r *SourceAmplitudeResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceAmplitude(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -211,6 +214,9 @@ func (r *SourceAmplitudeResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceAmplitude(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -247,6 +253,9 @@ func (r *SourceAmplitudeResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceAmplitude(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -264,6 +273,9 @@ func (r *SourceAmplitudeResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceAmplitude(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -309,6 +321,9 @@ func (r *SourceAmplitudeResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceAmplitude(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_apifydataset_data_source.go b/internal/provider/source_apifydataset_data_source.go index 2759dbf9c..218f85d9e 100755 --- a/internal/provider/source_apifydataset_data_source.go +++ b/internal/provider/source_apifydataset_data_source.go @@ -133,6 +133,9 @@ func (r *SourceApifyDatasetDataSource) Read(ctx context.Context, req datasource. res, err := r.client.Sources.GetSourceApifyDataset(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_apifydataset_resource.go b/internal/provider/source_apifydataset_resource.go index d2667afc7..e6e4ccf9c 100755 --- a/internal/provider/source_apifydataset_resource.go +++ b/internal/provider/source_apifydataset_resource.go @@ -147,6 +147,9 @@ func (r *SourceApifyDatasetResource) Create(ctx context.Context, req resource.Cr res, err := r.client.Sources.CreateSourceApifyDataset(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourceApifyDatasetResource) Read(ctx context.Context, req resource.Read res, err := r.client.Sources.GetSourceApifyDataset(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourceApifyDatasetResource) Update(ctx context.Context, req resource.Up res, err := r.client.Sources.PutSourceApifyDataset(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourceApifyDatasetResource) Update(ctx context.Context, req resource.Up getResponse, err := r.client.Sources.GetSourceApifyDataset(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourceApifyDatasetResource) Delete(ctx context.Context, req resource.De res, err := r.client.Sources.DeleteSourceApifyDataset(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_asana_data_source.go b/internal/provider/source_asana_data_source.go index 728559754..eb8f6efbc 100755 --- a/internal/provider/source_asana_data_source.go +++ b/internal/provider/source_asana_data_source.go @@ -225,6 +225,9 @@ func (r *SourceAsanaDataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourceAsana(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_asana_resource.go b/internal/provider/source_asana_resource.go index e8d46de70..050ab5440 100755 --- a/internal/provider/source_asana_resource.go +++ b/internal/provider/source_asana_resource.go @@ -239,6 +239,9 @@ func (r *SourceAsanaResource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourceAsana(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -284,6 +287,9 @@ func (r *SourceAsanaResource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourceAsana(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -320,6 +326,9 @@ func (r *SourceAsanaResource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourceAsana(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -337,6 +346,9 @@ func (r *SourceAsanaResource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourceAsana(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -382,6 +394,9 @@ func (r *SourceAsanaResource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourceAsana(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_auth0_data_source.go b/internal/provider/source_auth0_data_source.go index 1eac76eed..5b700044b 100755 --- a/internal/provider/source_auth0_data_source.go +++ b/internal/provider/source_auth0_data_source.go @@ -226,6 +226,9 @@ func (r *SourceAuth0DataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourceAuth0(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_auth0_resource.go b/internal/provider/source_auth0_resource.go index ca8b9abd8..8641185d1 100755 --- a/internal/provider/source_auth0_resource.go +++ b/internal/provider/source_auth0_resource.go @@ -240,6 +240,9 @@ func (r *SourceAuth0Resource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourceAuth0(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -285,6 +288,9 @@ func (r *SourceAuth0Resource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourceAuth0(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -321,6 +327,9 @@ func (r *SourceAuth0Resource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourceAuth0(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -338,6 +347,9 @@ func (r *SourceAuth0Resource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourceAuth0(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -383,6 +395,9 @@ func (r *SourceAuth0Resource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourceAuth0(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_awscloudtrail_data_source.go b/internal/provider/source_awscloudtrail_data_source.go index 1768fb3af..bc9540e81 100755 --- a/internal/provider/source_awscloudtrail_data_source.go +++ b/internal/provider/source_awscloudtrail_data_source.go @@ -145,6 +145,9 @@ func (r *SourceAwsCloudtrailDataSource) Read(ctx context.Context, req datasource res, err := r.client.Sources.GetSourceAwsCloudtrail(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_awscloudtrail_resource.go b/internal/provider/source_awscloudtrail_resource.go index 71fccc106..a317b1d5c 100755 --- a/internal/provider/source_awscloudtrail_resource.go +++ b/internal/provider/source_awscloudtrail_resource.go @@ -159,6 +159,9 @@ func (r *SourceAwsCloudtrailResource) Create(ctx context.Context, req resource.C res, err := r.client.Sources.CreateSourceAwsCloudtrail(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -204,6 +207,9 @@ func (r *SourceAwsCloudtrailResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Sources.GetSourceAwsCloudtrail(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +246,9 @@ func (r *SourceAwsCloudtrailResource) Update(ctx context.Context, req resource.U res, err := r.client.Sources.PutSourceAwsCloudtrail(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -257,6 +266,9 @@ func (r *SourceAwsCloudtrailResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Sources.GetSourceAwsCloudtrail(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -302,6 +314,9 @@ func (r *SourceAwsCloudtrailResource) Delete(ctx context.Context, req resource.D res, err := r.client.Sources.DeleteSourceAwsCloudtrail(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_azureblobstorage_data_source.go b/internal/provider/source_azureblobstorage_data_source.go index b0c2f60e2..fae57860f 100755 --- a/internal/provider/source_azureblobstorage_data_source.go +++ b/internal/provider/source_azureblobstorage_data_source.go @@ -189,6 +189,9 @@ func (r *SourceAzureBlobStorageDataSource) Read(ctx context.Context, req datasou res, err := r.client.Sources.GetSourceAzureBlobStorage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_azureblobstorage_resource.go b/internal/provider/source_azureblobstorage_resource.go index 4284be16c..da505d5e2 100755 --- a/internal/provider/source_azureblobstorage_resource.go +++ b/internal/provider/source_azureblobstorage_resource.go @@ -203,6 +203,9 @@ func (r *SourceAzureBlobStorageResource) Create(ctx context.Context, req resourc res, err := r.client.Sources.CreateSourceAzureBlobStorage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -248,6 +251,9 @@ func (r *SourceAzureBlobStorageResource) Read(ctx context.Context, req resource. res, err := r.client.Sources.GetSourceAzureBlobStorage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -284,6 +290,9 @@ func (r *SourceAzureBlobStorageResource) Update(ctx context.Context, req resourc res, err := r.client.Sources.PutSourceAzureBlobStorage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -301,6 +310,9 @@ func (r *SourceAzureBlobStorageResource) Update(ctx context.Context, req resourc getResponse, err := r.client.Sources.GetSourceAzureBlobStorage(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -346,6 +358,9 @@ func (r *SourceAzureBlobStorageResource) Delete(ctx context.Context, req resourc res, err := r.client.Sources.DeleteSourceAzureBlobStorage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_azuretable_data_source.go b/internal/provider/source_azuretable_data_source.go index 70cfb6991..5d5ef33a7 100755 --- a/internal/provider/source_azuretable_data_source.go +++ b/internal/provider/source_azuretable_data_source.go @@ -137,6 +137,9 @@ func (r *SourceAzureTableDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceAzureTable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_azuretable_resource.go b/internal/provider/source_azuretable_resource.go index 37dc1f238..925bbde56 100755 --- a/internal/provider/source_azuretable_resource.go +++ b/internal/provider/source_azuretable_resource.go @@ -151,6 +151,9 @@ func (r *SourceAzureTableResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceAzureTable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceAzureTableResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceAzureTable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceAzureTableResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceAzureTable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceAzureTableResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceAzureTable(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceAzureTableResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceAzureTable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_bamboohr_data_source.go b/internal/provider/source_bamboohr_data_source.go index 66003f50a..eaa1b9b15 100755 --- a/internal/provider/source_bamboohr_data_source.go +++ b/internal/provider/source_bamboohr_data_source.go @@ -141,6 +141,9 @@ func (r *SourceBambooHrDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceBambooHr(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_bamboohr_resource.go b/internal/provider/source_bamboohr_resource.go index c6528eaa7..46df8ba62 100755 --- a/internal/provider/source_bamboohr_resource.go +++ b/internal/provider/source_bamboohr_resource.go @@ -155,6 +155,9 @@ func (r *SourceBambooHrResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceBambooHr(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -200,6 +203,9 @@ func (r *SourceBambooHrResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceBambooHr(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -236,6 +242,9 @@ func (r *SourceBambooHrResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceBambooHr(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +262,9 @@ func (r *SourceBambooHrResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceBambooHr(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -298,6 +310,9 @@ func (r *SourceBambooHrResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceBambooHr(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_bigcommerce_data_source.go b/internal/provider/source_bigcommerce_data_source.go index 0da827921..364c04149 100755 --- a/internal/provider/source_bigcommerce_data_source.go +++ b/internal/provider/source_bigcommerce_data_source.go @@ -137,6 +137,9 @@ func (r *SourceBigcommerceDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Sources.GetSourceBigcommerce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_bigcommerce_resource.go b/internal/provider/source_bigcommerce_resource.go index bb358079d..77aa3aa23 100755 --- a/internal/provider/source_bigcommerce_resource.go +++ b/internal/provider/source_bigcommerce_resource.go @@ -151,6 +151,9 @@ func (r *SourceBigcommerceResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Sources.CreateSourceBigcommerce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceBigcommerceResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Sources.GetSourceBigcommerce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceBigcommerceResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Sources.PutSourceBigcommerce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceBigcommerceResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Sources.GetSourceBigcommerce(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceBigcommerceResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Sources.DeleteSourceBigcommerce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_bigquery_data_source.go b/internal/provider/source_bigquery_data_source.go index 864171825..3265ef716 100755 --- a/internal/provider/source_bigquery_data_source.go +++ b/internal/provider/source_bigquery_data_source.go @@ -137,6 +137,9 @@ func (r *SourceBigqueryDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceBigquery(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_bigquery_resource.go b/internal/provider/source_bigquery_resource.go index 3e5c4fb12..83730b24c 100755 --- a/internal/provider/source_bigquery_resource.go +++ b/internal/provider/source_bigquery_resource.go @@ -151,6 +151,9 @@ func (r *SourceBigqueryResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceBigquery(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceBigqueryResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceBigquery(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceBigqueryResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceBigquery(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceBigqueryResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceBigquery(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceBigqueryResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceBigquery(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_bingads_data_source.go b/internal/provider/source_bingads_data_source.go index ea0ccdebc..d6acef812 100755 --- a/internal/provider/source_bingads_data_source.go +++ b/internal/provider/source_bingads_data_source.go @@ -166,6 +166,9 @@ func (r *SourceBingAdsDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceBingAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_bingads_resource.go b/internal/provider/source_bingads_resource.go index 50fb59d0f..ea7e0c553 100755 --- a/internal/provider/source_bingads_resource.go +++ b/internal/provider/source_bingads_resource.go @@ -180,6 +180,9 @@ func (r *SourceBingAdsResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceBingAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -225,6 +228,9 @@ func (r *SourceBingAdsResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceBingAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -261,6 +267,9 @@ func (r *SourceBingAdsResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceBingAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -278,6 +287,9 @@ func (r *SourceBingAdsResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceBingAds(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -323,6 +335,9 @@ func (r *SourceBingAdsResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceBingAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_braintree_data_source.go b/internal/provider/source_braintree_data_source.go index e605e10da..8dee5de99 100755 --- a/internal/provider/source_braintree_data_source.go +++ b/internal/provider/source_braintree_data_source.go @@ -158,6 +158,9 @@ func (r *SourceBraintreeDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceBraintree(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_braintree_resource.go b/internal/provider/source_braintree_resource.go index d724992bb..c4504578a 100755 --- a/internal/provider/source_braintree_resource.go +++ b/internal/provider/source_braintree_resource.go @@ -172,6 +172,9 @@ func (r *SourceBraintreeResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceBraintree(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -217,6 +220,9 @@ func (r *SourceBraintreeResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceBraintree(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +259,9 @@ func (r *SourceBraintreeResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceBraintree(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -270,6 +279,9 @@ func (r *SourceBraintreeResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceBraintree(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -315,6 +327,9 @@ func (r *SourceBraintreeResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceBraintree(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_braze_data_source.go b/internal/provider/source_braze_data_source.go index 1d06904ba..726e2b04b 100755 --- a/internal/provider/source_braze_data_source.go +++ b/internal/provider/source_braze_data_source.go @@ -141,6 +141,9 @@ func (r *SourceBrazeDataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourceBraze(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_braze_resource.go b/internal/provider/source_braze_resource.go index 9e10783dd..e55c3b0b9 100755 --- a/internal/provider/source_braze_resource.go +++ b/internal/provider/source_braze_resource.go @@ -155,6 +155,9 @@ func (r *SourceBrazeResource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourceBraze(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -200,6 +203,9 @@ func (r *SourceBrazeResource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourceBraze(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -236,6 +242,9 @@ func (r *SourceBrazeResource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourceBraze(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +262,9 @@ func (r *SourceBrazeResource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourceBraze(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -298,6 +310,9 @@ func (r *SourceBrazeResource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourceBraze(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_chargebee_data_source.go b/internal/provider/source_chargebee_data_source.go index ba7362536..599cffbd4 100755 --- a/internal/provider/source_chargebee_data_source.go +++ b/internal/provider/source_chargebee_data_source.go @@ -152,6 +152,9 @@ func (r *SourceChargebeeDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceChargebee(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_chargebee_resource.go b/internal/provider/source_chargebee_resource.go index 321bbcbae..ed3a7b728 100755 --- a/internal/provider/source_chargebee_resource.go +++ b/internal/provider/source_chargebee_resource.go @@ -166,6 +166,9 @@ func (r *SourceChargebeeResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceChargebee(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -211,6 +214,9 @@ func (r *SourceChargebeeResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceChargebee(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -247,6 +253,9 @@ func (r *SourceChargebeeResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceChargebee(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -264,6 +273,9 @@ func (r *SourceChargebeeResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceChargebee(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -309,6 +321,9 @@ func (r *SourceChargebeeResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceChargebee(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_chartmogul_data_source.go b/internal/provider/source_chartmogul_data_source.go index d658144f0..223bbcb01 100755 --- a/internal/provider/source_chartmogul_data_source.go +++ b/internal/provider/source_chartmogul_data_source.go @@ -150,6 +150,9 @@ func (r *SourceChartmogulDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceChartmogul(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_chartmogul_resource.go b/internal/provider/source_chartmogul_resource.go index 4b9981f0a..49586803c 100755 --- a/internal/provider/source_chartmogul_resource.go +++ b/internal/provider/source_chartmogul_resource.go @@ -164,6 +164,9 @@ func (r *SourceChartmogulResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceChartmogul(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -209,6 +212,9 @@ func (r *SourceChartmogulResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceChartmogul(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +251,9 @@ func (r *SourceChartmogulResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceChartmogul(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -262,6 +271,9 @@ func (r *SourceChartmogulResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceChartmogul(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -307,6 +319,9 @@ func (r *SourceChartmogulResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceChartmogul(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_clickhouse_data_source.go b/internal/provider/source_clickhouse_data_source.go index 2398c98ee..d7407a934 100755 --- a/internal/provider/source_clickhouse_data_source.go +++ b/internal/provider/source_clickhouse_data_source.go @@ -315,6 +315,9 @@ func (r *SourceClickhouseDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceClickhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_clickhouse_resource.go b/internal/provider/source_clickhouse_resource.go index 79955ef24..40ec45f68 100755 --- a/internal/provider/source_clickhouse_resource.go +++ b/internal/provider/source_clickhouse_resource.go @@ -329,6 +329,9 @@ func (r *SourceClickhouseResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceClickhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -374,6 +377,9 @@ func (r *SourceClickhouseResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceClickhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -410,6 +416,9 @@ func (r *SourceClickhouseResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceClickhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -427,6 +436,9 @@ func (r *SourceClickhouseResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceClickhouse(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -472,6 +484,9 @@ func (r *SourceClickhouseResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceClickhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_clickupapi_data_source.go b/internal/provider/source_clickupapi_data_source.go index 4eed4dde6..4971a9634 100755 --- a/internal/provider/source_clickupapi_data_source.go +++ b/internal/provider/source_clickupapi_data_source.go @@ -149,6 +149,9 @@ func (r *SourceClickupAPIDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceClickupAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_clickupapi_resource.go b/internal/provider/source_clickupapi_resource.go index de172812a..95a6989c1 100755 --- a/internal/provider/source_clickupapi_resource.go +++ b/internal/provider/source_clickupapi_resource.go @@ -163,6 +163,9 @@ func (r *SourceClickupAPIResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceClickupAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -208,6 +211,9 @@ func (r *SourceClickupAPIResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceClickupAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +250,9 @@ func (r *SourceClickupAPIResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceClickupAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -261,6 +270,9 @@ func (r *SourceClickupAPIResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceClickupAPI(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -306,6 +318,9 @@ func (r *SourceClickupAPIResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceClickupAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_closecom_data_source.go b/internal/provider/source_closecom_data_source.go index a905f11dd..3cb9a4f4c 100755 --- a/internal/provider/source_closecom_data_source.go +++ b/internal/provider/source_closecom_data_source.go @@ -137,6 +137,9 @@ func (r *SourceCloseComDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceCloseCom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_closecom_resource.go b/internal/provider/source_closecom_resource.go index 97fc41bdc..706c0b72c 100755 --- a/internal/provider/source_closecom_resource.go +++ b/internal/provider/source_closecom_resource.go @@ -151,6 +151,9 @@ func (r *SourceCloseComResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceCloseCom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceCloseComResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceCloseCom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceCloseComResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceCloseCom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceCloseComResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceCloseCom(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceCloseComResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceCloseCom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_coda_data_source.go b/internal/provider/source_coda_data_source.go index f43b44cf5..914f61f88 100755 --- a/internal/provider/source_coda_data_source.go +++ b/internal/provider/source_coda_data_source.go @@ -129,6 +129,9 @@ func (r *SourceCodaDataSource) Read(ctx context.Context, req datasource.ReadRequ res, err := r.client.Sources.GetSourceCoda(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_coda_resource.go b/internal/provider/source_coda_resource.go index e4b4db55b..ebc63d22a 100755 --- a/internal/provider/source_coda_resource.go +++ b/internal/provider/source_coda_resource.go @@ -143,6 +143,9 @@ func (r *SourceCodaResource) Create(ctx context.Context, req resource.CreateRequ res, err := r.client.Sources.CreateSourceCoda(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceCodaResource) Read(ctx context.Context, req resource.ReadRequest, res, err := r.client.Sources.GetSourceCoda(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceCodaResource) Update(ctx context.Context, req resource.UpdateRequ res, err := r.client.Sources.PutSourceCoda(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceCodaResource) Update(ctx context.Context, req resource.UpdateRequ getResponse, err := r.client.Sources.GetSourceCoda(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceCodaResource) Delete(ctx context.Context, req resource.DeleteRequ res, err := r.client.Sources.DeleteSourceCoda(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_coinapi_data_source.go b/internal/provider/source_coinapi_data_source.go index 6d02554a0..31a4f7633 100755 --- a/internal/provider/source_coinapi_data_source.go +++ b/internal/provider/source_coinapi_data_source.go @@ -169,6 +169,9 @@ func (r *SourceCoinAPIDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceCoinAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_coinapi_resource.go b/internal/provider/source_coinapi_resource.go index c0d89f175..b27341228 100755 --- a/internal/provider/source_coinapi_resource.go +++ b/internal/provider/source_coinapi_resource.go @@ -183,6 +183,9 @@ func (r *SourceCoinAPIResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceCoinAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +231,9 @@ func (r *SourceCoinAPIResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceCoinAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -264,6 +270,9 @@ func (r *SourceCoinAPIResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceCoinAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -281,6 +290,9 @@ func (r *SourceCoinAPIResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceCoinAPI(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -326,6 +338,9 @@ func (r *SourceCoinAPIResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceCoinAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_coinmarketcap_data_source.go b/internal/provider/source_coinmarketcap_data_source.go index 9f4d197ba..f56c94225 100755 --- a/internal/provider/source_coinmarketcap_data_source.go +++ b/internal/provider/source_coinmarketcap_data_source.go @@ -145,6 +145,9 @@ func (r *SourceCoinmarketcapDataSource) Read(ctx context.Context, req datasource res, err := r.client.Sources.GetSourceCoinmarketcap(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_coinmarketcap_resource.go b/internal/provider/source_coinmarketcap_resource.go index 2916515b8..2305b3627 100755 --- a/internal/provider/source_coinmarketcap_resource.go +++ b/internal/provider/source_coinmarketcap_resource.go @@ -159,6 +159,9 @@ func (r *SourceCoinmarketcapResource) Create(ctx context.Context, req resource.C res, err := r.client.Sources.CreateSourceCoinmarketcap(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -204,6 +207,9 @@ func (r *SourceCoinmarketcapResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Sources.GetSourceCoinmarketcap(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +246,9 @@ func (r *SourceCoinmarketcapResource) Update(ctx context.Context, req resource.U res, err := r.client.Sources.PutSourceCoinmarketcap(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -257,6 +266,9 @@ func (r *SourceCoinmarketcapResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Sources.GetSourceCoinmarketcap(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -302,6 +314,9 @@ func (r *SourceCoinmarketcapResource) Delete(ctx context.Context, req resource.D res, err := r.client.Sources.DeleteSourceCoinmarketcap(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_configcat_data_source.go b/internal/provider/source_configcat_data_source.go index 945e98dd8..6a09f342c 100755 --- a/internal/provider/source_configcat_data_source.go +++ b/internal/provider/source_configcat_data_source.go @@ -133,6 +133,9 @@ func (r *SourceConfigcatDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceConfigcat(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_configcat_resource.go b/internal/provider/source_configcat_resource.go index a25bef084..4a667f93d 100755 --- a/internal/provider/source_configcat_resource.go +++ b/internal/provider/source_configcat_resource.go @@ -147,6 +147,9 @@ func (r *SourceConfigcatResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceConfigcat(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourceConfigcatResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceConfigcat(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourceConfigcatResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceConfigcat(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourceConfigcatResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceConfigcat(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourceConfigcatResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceConfigcat(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_confluence_data_source.go b/internal/provider/source_confluence_data_source.go index 755730b08..e5b317012 100755 --- a/internal/provider/source_confluence_data_source.go +++ b/internal/provider/source_confluence_data_source.go @@ -137,6 +137,9 @@ func (r *SourceConfluenceDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceConfluence(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_confluence_resource.go b/internal/provider/source_confluence_resource.go index 8714cb322..d624110a9 100755 --- a/internal/provider/source_confluence_resource.go +++ b/internal/provider/source_confluence_resource.go @@ -151,6 +151,9 @@ func (r *SourceConfluenceResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceConfluence(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceConfluenceResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceConfluence(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceConfluenceResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceConfluence(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceConfluenceResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceConfluence(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceConfluenceResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceConfluence(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_datascope_data_source.go b/internal/provider/source_datascope_data_source.go index b455b7795..77b2c7b61 100755 --- a/internal/provider/source_datascope_data_source.go +++ b/internal/provider/source_datascope_data_source.go @@ -133,6 +133,9 @@ func (r *SourceDatascopeDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceDatascope(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_datascope_resource.go b/internal/provider/source_datascope_resource.go index cf7bbfc45..cef180629 100755 --- a/internal/provider/source_datascope_resource.go +++ b/internal/provider/source_datascope_resource.go @@ -147,6 +147,9 @@ func (r *SourceDatascopeResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceDatascope(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourceDatascopeResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceDatascope(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourceDatascopeResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceDatascope(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourceDatascopeResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceDatascope(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourceDatascopeResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceDatascope(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_delighted_data_source.go b/internal/provider/source_delighted_data_source.go index 012243fa8..5331bc74c 100755 --- a/internal/provider/source_delighted_data_source.go +++ b/internal/provider/source_delighted_data_source.go @@ -137,6 +137,9 @@ func (r *SourceDelightedDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceDelighted(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_delighted_resource.go b/internal/provider/source_delighted_resource.go index 94e924a68..62a898504 100755 --- a/internal/provider/source_delighted_resource.go +++ b/internal/provider/source_delighted_resource.go @@ -151,6 +151,9 @@ func (r *SourceDelightedResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceDelighted(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceDelightedResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceDelighted(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceDelightedResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceDelighted(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceDelightedResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceDelighted(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceDelightedResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceDelighted(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_dixa_data_source.go b/internal/provider/source_dixa_data_source.go index d8b49f157..430ba7472 100755 --- a/internal/provider/source_dixa_data_source.go +++ b/internal/provider/source_dixa_data_source.go @@ -137,6 +137,9 @@ func (r *SourceDixaDataSource) Read(ctx context.Context, req datasource.ReadRequ res, err := r.client.Sources.GetSourceDixa(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_dixa_resource.go b/internal/provider/source_dixa_resource.go index 96a1108df..687ecc21e 100755 --- a/internal/provider/source_dixa_resource.go +++ b/internal/provider/source_dixa_resource.go @@ -151,6 +151,9 @@ func (r *SourceDixaResource) Create(ctx context.Context, req resource.CreateRequ res, err := r.client.Sources.CreateSourceDixa(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceDixaResource) Read(ctx context.Context, req resource.ReadRequest, res, err := r.client.Sources.GetSourceDixa(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceDixaResource) Update(ctx context.Context, req resource.UpdateRequ res, err := r.client.Sources.PutSourceDixa(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceDixaResource) Update(ctx context.Context, req resource.UpdateRequ getResponse, err := r.client.Sources.GetSourceDixa(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceDixaResource) Delete(ctx context.Context, req resource.DeleteRequ res, err := r.client.Sources.DeleteSourceDixa(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_dockerhub_data_source.go b/internal/provider/source_dockerhub_data_source.go index d0e6cfda6..6eaf070b8 100755 --- a/internal/provider/source_dockerhub_data_source.go +++ b/internal/provider/source_dockerhub_data_source.go @@ -129,6 +129,9 @@ func (r *SourceDockerhubDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceDockerhub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_dockerhub_resource.go b/internal/provider/source_dockerhub_resource.go index 335aec2cb..f8e81a12e 100755 --- a/internal/provider/source_dockerhub_resource.go +++ b/internal/provider/source_dockerhub_resource.go @@ -143,6 +143,9 @@ func (r *SourceDockerhubResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceDockerhub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceDockerhubResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceDockerhub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceDockerhubResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceDockerhub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceDockerhubResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceDockerhub(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceDockerhubResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceDockerhub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_dremio_data_source.go b/internal/provider/source_dremio_data_source.go index 150c92035..75d85cbc0 100755 --- a/internal/provider/source_dremio_data_source.go +++ b/internal/provider/source_dremio_data_source.go @@ -133,6 +133,9 @@ func (r *SourceDremioDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceDremio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_dremio_resource.go b/internal/provider/source_dremio_resource.go index 460d922da..5828952ea 100755 --- a/internal/provider/source_dremio_resource.go +++ b/internal/provider/source_dremio_resource.go @@ -147,6 +147,9 @@ func (r *SourceDremioResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceDremio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourceDremioResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceDremio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourceDremioResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceDremio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourceDremioResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceDremio(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourceDremioResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceDremio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_dynamodb_data_source.go b/internal/provider/source_dynamodb_data_source.go index 83a712cf0..c8edeaab4 100755 --- a/internal/provider/source_dynamodb_data_source.go +++ b/internal/provider/source_dynamodb_data_source.go @@ -176,6 +176,9 @@ func (r *SourceDynamodbDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceDynamodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_dynamodb_resource.go b/internal/provider/source_dynamodb_resource.go index b62fa69dd..ffaed4353 100755 --- a/internal/provider/source_dynamodb_resource.go +++ b/internal/provider/source_dynamodb_resource.go @@ -190,6 +190,9 @@ func (r *SourceDynamodbResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceDynamodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -235,6 +238,9 @@ func (r *SourceDynamodbResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceDynamodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -271,6 +277,9 @@ func (r *SourceDynamodbResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceDynamodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -288,6 +297,9 @@ func (r *SourceDynamodbResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceDynamodb(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -333,6 +345,9 @@ func (r *SourceDynamodbResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceDynamodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_e2etestcloud_data_source.go b/internal/provider/source_e2etestcloud_data_source.go index b1607be52..69a91fcef 100755 --- a/internal/provider/source_e2etestcloud_data_source.go +++ b/internal/provider/source_e2etestcloud_data_source.go @@ -247,6 +247,9 @@ func (r *SourceE2eTestCloudDataSource) Read(ctx context.Context, req datasource. res, err := r.client.Sources.GetSourceE2eTestCloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_e2etestcloud_resource.go b/internal/provider/source_e2etestcloud_resource.go index 873d0f915..5d0814123 100755 --- a/internal/provider/source_e2etestcloud_resource.go +++ b/internal/provider/source_e2etestcloud_resource.go @@ -261,6 +261,9 @@ func (r *SourceE2eTestCloudResource) Create(ctx context.Context, req resource.Cr res, err := r.client.Sources.CreateSourceE2eTestCloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -306,6 +309,9 @@ func (r *SourceE2eTestCloudResource) Read(ctx context.Context, req resource.Read res, err := r.client.Sources.GetSourceE2eTestCloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -342,6 +348,9 @@ func (r *SourceE2eTestCloudResource) Update(ctx context.Context, req resource.Up res, err := r.client.Sources.PutSourceE2eTestCloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -359,6 +368,9 @@ func (r *SourceE2eTestCloudResource) Update(ctx context.Context, req resource.Up getResponse, err := r.client.Sources.GetSourceE2eTestCloud(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -404,6 +416,9 @@ func (r *SourceE2eTestCloudResource) Delete(ctx context.Context, req resource.De res, err := r.client.Sources.DeleteSourceE2eTestCloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_emailoctopus_data_source.go b/internal/provider/source_emailoctopus_data_source.go index ae48edd6a..a9b4f9275 100755 --- a/internal/provider/source_emailoctopus_data_source.go +++ b/internal/provider/source_emailoctopus_data_source.go @@ -129,6 +129,9 @@ func (r *SourceEmailoctopusDataSource) Read(ctx context.Context, req datasource. res, err := r.client.Sources.GetSourceEmailoctopus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_emailoctopus_resource.go b/internal/provider/source_emailoctopus_resource.go index b5b3efcf5..3c9f290f0 100755 --- a/internal/provider/source_emailoctopus_resource.go +++ b/internal/provider/source_emailoctopus_resource.go @@ -143,6 +143,9 @@ func (r *SourceEmailoctopusResource) Create(ctx context.Context, req resource.Cr res, err := r.client.Sources.CreateSourceEmailoctopus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceEmailoctopusResource) Read(ctx context.Context, req resource.Read res, err := r.client.Sources.GetSourceEmailoctopus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceEmailoctopusResource) Update(ctx context.Context, req resource.Up res, err := r.client.Sources.PutSourceEmailoctopus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceEmailoctopusResource) Update(ctx context.Context, req resource.Up getResponse, err := r.client.Sources.GetSourceEmailoctopus(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceEmailoctopusResource) Delete(ctx context.Context, req resource.De res, err := r.client.Sources.DeleteSourceEmailoctopus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_exchangerates_data_source.go b/internal/provider/source_exchangerates_data_source.go index b02780bc2..f69f80eb8 100755 --- a/internal/provider/source_exchangerates_data_source.go +++ b/internal/provider/source_exchangerates_data_source.go @@ -145,6 +145,9 @@ func (r *SourceExchangeRatesDataSource) Read(ctx context.Context, req datasource res, err := r.client.Sources.GetSourceExchangeRates(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_exchangerates_resource.go b/internal/provider/source_exchangerates_resource.go index 4cfe9255e..52b1d6aea 100755 --- a/internal/provider/source_exchangerates_resource.go +++ b/internal/provider/source_exchangerates_resource.go @@ -159,6 +159,9 @@ func (r *SourceExchangeRatesResource) Create(ctx context.Context, req resource.C res, err := r.client.Sources.CreateSourceExchangeRates(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -204,6 +207,9 @@ func (r *SourceExchangeRatesResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Sources.GetSourceExchangeRates(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +246,9 @@ func (r *SourceExchangeRatesResource) Update(ctx context.Context, req resource.U res, err := r.client.Sources.PutSourceExchangeRates(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -257,6 +266,9 @@ func (r *SourceExchangeRatesResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Sources.GetSourceExchangeRates(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -302,6 +314,9 @@ func (r *SourceExchangeRatesResource) Delete(ctx context.Context, req resource.D res, err := r.client.Sources.DeleteSourceExchangeRates(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_facebookmarketing_data_source.go b/internal/provider/source_facebookmarketing_data_source.go index 7d0e15792..5d8d5432b 100755 --- a/internal/provider/source_facebookmarketing_data_source.go +++ b/internal/provider/source_facebookmarketing_data_source.go @@ -234,6 +234,9 @@ func (r *SourceFacebookMarketingDataSource) Read(ctx context.Context, req dataso res, err := r.client.Sources.GetSourceFacebookMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_facebookmarketing_resource.go b/internal/provider/source_facebookmarketing_resource.go index 5ee307829..c7835ce56 100755 --- a/internal/provider/source_facebookmarketing_resource.go +++ b/internal/provider/source_facebookmarketing_resource.go @@ -248,6 +248,9 @@ func (r *SourceFacebookMarketingResource) Create(ctx context.Context, req resour res, err := r.client.Sources.CreateSourceFacebookMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -293,6 +296,9 @@ func (r *SourceFacebookMarketingResource) Read(ctx context.Context, req resource res, err := r.client.Sources.GetSourceFacebookMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -329,6 +335,9 @@ func (r *SourceFacebookMarketingResource) Update(ctx context.Context, req resour res, err := r.client.Sources.PutSourceFacebookMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -346,6 +355,9 @@ func (r *SourceFacebookMarketingResource) Update(ctx context.Context, req resour getResponse, err := r.client.Sources.GetSourceFacebookMarketing(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -391,6 +403,9 @@ func (r *SourceFacebookMarketingResource) Delete(ctx context.Context, req resour res, err := r.client.Sources.DeleteSourceFacebookMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_facebookpages_data_source.go b/internal/provider/source_facebookpages_data_source.go index c858be22f..41d632dee 100755 --- a/internal/provider/source_facebookpages_data_source.go +++ b/internal/provider/source_facebookpages_data_source.go @@ -133,6 +133,9 @@ func (r *SourceFacebookPagesDataSource) Read(ctx context.Context, req datasource res, err := r.client.Sources.GetSourceFacebookPages(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_facebookpages_resource.go b/internal/provider/source_facebookpages_resource.go index cd56f5319..b60f0da34 100755 --- a/internal/provider/source_facebookpages_resource.go +++ b/internal/provider/source_facebookpages_resource.go @@ -147,6 +147,9 @@ func (r *SourceFacebookPagesResource) Create(ctx context.Context, req resource.C res, err := r.client.Sources.CreateSourceFacebookPages(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourceFacebookPagesResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Sources.GetSourceFacebookPages(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourceFacebookPagesResource) Update(ctx context.Context, req resource.U res, err := r.client.Sources.PutSourceFacebookPages(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourceFacebookPagesResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Sources.GetSourceFacebookPages(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourceFacebookPagesResource) Delete(ctx context.Context, req resource.D res, err := r.client.Sources.DeleteSourceFacebookPages(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_faker_data_source.go b/internal/provider/source_faker_data_source.go index 1c8c504fd..ebb0f0763 100755 --- a/internal/provider/source_faker_data_source.go +++ b/internal/provider/source_faker_data_source.go @@ -145,6 +145,9 @@ func (r *SourceFakerDataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourceFaker(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_faker_resource.go b/internal/provider/source_faker_resource.go index ae6603b4c..5c4c63d07 100755 --- a/internal/provider/source_faker_resource.go +++ b/internal/provider/source_faker_resource.go @@ -159,6 +159,9 @@ func (r *SourceFakerResource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourceFaker(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -204,6 +207,9 @@ func (r *SourceFakerResource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourceFaker(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +246,9 @@ func (r *SourceFakerResource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourceFaker(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -257,6 +266,9 @@ func (r *SourceFakerResource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourceFaker(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -302,6 +314,9 @@ func (r *SourceFakerResource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourceFaker(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_fauna_data_source.go b/internal/provider/source_fauna_data_source.go index 8c2f91d36..f839d5605 100755 --- a/internal/provider/source_fauna_data_source.go +++ b/internal/provider/source_fauna_data_source.go @@ -246,6 +246,9 @@ func (r *SourceFaunaDataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourceFauna(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_fauna_resource.go b/internal/provider/source_fauna_resource.go index 44a6aa062..f58f4f034 100755 --- a/internal/provider/source_fauna_resource.go +++ b/internal/provider/source_fauna_resource.go @@ -260,6 +260,9 @@ func (r *SourceFaunaResource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourceFauna(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -305,6 +308,9 @@ func (r *SourceFaunaResource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourceFauna(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -341,6 +347,9 @@ func (r *SourceFaunaResource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourceFauna(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -358,6 +367,9 @@ func (r *SourceFaunaResource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourceFauna(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -403,6 +415,9 @@ func (r *SourceFaunaResource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourceFauna(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_filesecure_data_source.go b/internal/provider/source_filesecure_data_source.go index 7bc53dd97..be66e39a3 100755 --- a/internal/provider/source_filesecure_data_source.go +++ b/internal/provider/source_filesecure_data_source.go @@ -502,6 +502,9 @@ func (r *SourceFileSecureDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceFileSecure(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_filesecure_resource.go b/internal/provider/source_filesecure_resource.go index f54dc43d1..5a2cbe600 100755 --- a/internal/provider/source_filesecure_resource.go +++ b/internal/provider/source_filesecure_resource.go @@ -516,6 +516,9 @@ func (r *SourceFileSecureResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceFileSecure(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -561,6 +564,9 @@ func (r *SourceFileSecureResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceFileSecure(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -597,6 +603,9 @@ func (r *SourceFileSecureResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceFileSecure(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -614,6 +623,9 @@ func (r *SourceFileSecureResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceFileSecure(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -659,6 +671,9 @@ func (r *SourceFileSecureResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceFileSecure(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_firebolt_data_source.go b/internal/provider/source_firebolt_data_source.go index 1686675fb..6dd072324 100755 --- a/internal/provider/source_firebolt_data_source.go +++ b/internal/provider/source_firebolt_data_source.go @@ -149,6 +149,9 @@ func (r *SourceFireboltDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceFirebolt(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_firebolt_resource.go b/internal/provider/source_firebolt_resource.go index f5c6ed63a..a6e7f8e1d 100755 --- a/internal/provider/source_firebolt_resource.go +++ b/internal/provider/source_firebolt_resource.go @@ -163,6 +163,9 @@ func (r *SourceFireboltResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceFirebolt(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -208,6 +211,9 @@ func (r *SourceFireboltResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceFirebolt(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +250,9 @@ func (r *SourceFireboltResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceFirebolt(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -261,6 +270,9 @@ func (r *SourceFireboltResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceFirebolt(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -306,6 +318,9 @@ func (r *SourceFireboltResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceFirebolt(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_freshcaller_data_source.go b/internal/provider/source_freshcaller_data_source.go index 7137d2e79..fbe2dc59a 100755 --- a/internal/provider/source_freshcaller_data_source.go +++ b/internal/provider/source_freshcaller_data_source.go @@ -149,6 +149,9 @@ func (r *SourceFreshcallerDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Sources.GetSourceFreshcaller(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_freshcaller_resource.go b/internal/provider/source_freshcaller_resource.go index fe1dd3cf1..92c789c5c 100755 --- a/internal/provider/source_freshcaller_resource.go +++ b/internal/provider/source_freshcaller_resource.go @@ -163,6 +163,9 @@ func (r *SourceFreshcallerResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Sources.CreateSourceFreshcaller(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -208,6 +211,9 @@ func (r *SourceFreshcallerResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Sources.GetSourceFreshcaller(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +250,9 @@ func (r *SourceFreshcallerResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Sources.PutSourceFreshcaller(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -261,6 +270,9 @@ func (r *SourceFreshcallerResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Sources.GetSourceFreshcaller(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -306,6 +318,9 @@ func (r *SourceFreshcallerResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Sources.DeleteSourceFreshcaller(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_freshdesk_data_source.go b/internal/provider/source_freshdesk_data_source.go index 843841704..6adc96e50 100755 --- a/internal/provider/source_freshdesk_data_source.go +++ b/internal/provider/source_freshdesk_data_source.go @@ -145,6 +145,9 @@ func (r *SourceFreshdeskDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceFreshdesk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_freshdesk_resource.go b/internal/provider/source_freshdesk_resource.go index 1a8d43363..373a54248 100755 --- a/internal/provider/source_freshdesk_resource.go +++ b/internal/provider/source_freshdesk_resource.go @@ -159,6 +159,9 @@ func (r *SourceFreshdeskResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceFreshdesk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -204,6 +207,9 @@ func (r *SourceFreshdeskResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceFreshdesk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +246,9 @@ func (r *SourceFreshdeskResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceFreshdesk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -257,6 +266,9 @@ func (r *SourceFreshdeskResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceFreshdesk(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -302,6 +314,9 @@ func (r *SourceFreshdeskResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceFreshdesk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_freshsales_data_source.go b/internal/provider/source_freshsales_data_source.go index e3aaa4887..14ab8778b 100755 --- a/internal/provider/source_freshsales_data_source.go +++ b/internal/provider/source_freshsales_data_source.go @@ -133,6 +133,9 @@ func (r *SourceFreshsalesDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceFreshsales(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_freshsales_resource.go b/internal/provider/source_freshsales_resource.go index 4f8631e4a..42cdc5c39 100755 --- a/internal/provider/source_freshsales_resource.go +++ b/internal/provider/source_freshsales_resource.go @@ -147,6 +147,9 @@ func (r *SourceFreshsalesResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceFreshsales(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourceFreshsalesResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceFreshsales(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourceFreshsalesResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceFreshsales(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourceFreshsalesResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceFreshsales(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourceFreshsalesResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceFreshsales(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_freshservice_data_source.go b/internal/provider/source_freshservice_data_source.go index fdc6b05d2..4d91e0003 100755 --- a/internal/provider/source_freshservice_data_source.go +++ b/internal/provider/source_freshservice_data_source.go @@ -137,6 +137,9 @@ func (r *SourceFreshserviceDataSource) Read(ctx context.Context, req datasource. res, err := r.client.Sources.GetSourceFreshservice(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_freshservice_resource.go b/internal/provider/source_freshservice_resource.go index ce70275cf..bcefe00ab 100755 --- a/internal/provider/source_freshservice_resource.go +++ b/internal/provider/source_freshservice_resource.go @@ -151,6 +151,9 @@ func (r *SourceFreshserviceResource) Create(ctx context.Context, req resource.Cr res, err := r.client.Sources.CreateSourceFreshservice(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceFreshserviceResource) Read(ctx context.Context, req resource.Read res, err := r.client.Sources.GetSourceFreshservice(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceFreshserviceResource) Update(ctx context.Context, req resource.Up res, err := r.client.Sources.PutSourceFreshservice(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceFreshserviceResource) Update(ctx context.Context, req resource.Up getResponse, err := r.client.Sources.GetSourceFreshservice(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceFreshserviceResource) Delete(ctx context.Context, req resource.De res, err := r.client.Sources.DeleteSourceFreshservice(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_gcs_data_source.go b/internal/provider/source_gcs_data_source.go index 0225be678..d9867bc6d 100755 --- a/internal/provider/source_gcs_data_source.go +++ b/internal/provider/source_gcs_data_source.go @@ -137,6 +137,9 @@ func (r *SourceGcsDataSource) Read(ctx context.Context, req datasource.ReadReque res, err := r.client.Sources.GetSourceGcs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_gcs_resource.go b/internal/provider/source_gcs_resource.go index d17fd51cf..3b0693f2e 100755 --- a/internal/provider/source_gcs_resource.go +++ b/internal/provider/source_gcs_resource.go @@ -151,6 +151,9 @@ func (r *SourceGcsResource) Create(ctx context.Context, req resource.CreateReque res, err := r.client.Sources.CreateSourceGcs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceGcsResource) Read(ctx context.Context, req resource.ReadRequest, res, err := r.client.Sources.GetSourceGcs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceGcsResource) Update(ctx context.Context, req resource.UpdateReque res, err := r.client.Sources.PutSourceGcs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceGcsResource) Update(ctx context.Context, req resource.UpdateReque getResponse, err := r.client.Sources.GetSourceGcs(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceGcsResource) Delete(ctx context.Context, req resource.DeleteReque res, err := r.client.Sources.DeleteSourceGcs(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_getlago_data_source.go b/internal/provider/source_getlago_data_source.go index eca73cbc3..648e64108 100755 --- a/internal/provider/source_getlago_data_source.go +++ b/internal/provider/source_getlago_data_source.go @@ -129,6 +129,9 @@ func (r *SourceGetlagoDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceGetlago(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_getlago_resource.go b/internal/provider/source_getlago_resource.go index c1a856c85..a9410bf55 100755 --- a/internal/provider/source_getlago_resource.go +++ b/internal/provider/source_getlago_resource.go @@ -143,6 +143,9 @@ func (r *SourceGetlagoResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceGetlago(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceGetlagoResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceGetlago(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceGetlagoResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceGetlago(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceGetlagoResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceGetlago(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceGetlagoResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceGetlago(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_github_data_source.go b/internal/provider/source_github_data_source.go index 57f5bd6f8..3f4a66c06 100755 --- a/internal/provider/source_github_data_source.go +++ b/internal/provider/source_github_data_source.go @@ -230,6 +230,9 @@ func (r *SourceGithubDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceGithub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_github_resource.go b/internal/provider/source_github_resource.go index 339822780..d862fdebf 100755 --- a/internal/provider/source_github_resource.go +++ b/internal/provider/source_github_resource.go @@ -244,6 +244,9 @@ func (r *SourceGithubResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceGithub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -289,6 +292,9 @@ func (r *SourceGithubResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceGithub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -325,6 +331,9 @@ func (r *SourceGithubResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceGithub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -342,6 +351,9 @@ func (r *SourceGithubResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceGithub(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -387,6 +399,9 @@ func (r *SourceGithubResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceGithub(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_gitlab_data_source.go b/internal/provider/source_gitlab_data_source.go index 0d0e81eb1..1b32d1046 100755 --- a/internal/provider/source_gitlab_data_source.go +++ b/internal/provider/source_gitlab_data_source.go @@ -263,6 +263,9 @@ func (r *SourceGitlabDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceGitlab(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_gitlab_resource.go b/internal/provider/source_gitlab_resource.go index 77d127ad2..a49690d21 100755 --- a/internal/provider/source_gitlab_resource.go +++ b/internal/provider/source_gitlab_resource.go @@ -277,6 +277,9 @@ func (r *SourceGitlabResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceGitlab(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -322,6 +325,9 @@ func (r *SourceGitlabResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceGitlab(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -358,6 +364,9 @@ func (r *SourceGitlabResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceGitlab(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -375,6 +384,9 @@ func (r *SourceGitlabResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceGitlab(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -420,6 +432,9 @@ func (r *SourceGitlabResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceGitlab(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_glassfrog_data_source.go b/internal/provider/source_glassfrog_data_source.go index a8ff382ba..df08c109c 100755 --- a/internal/provider/source_glassfrog_data_source.go +++ b/internal/provider/source_glassfrog_data_source.go @@ -129,6 +129,9 @@ func (r *SourceGlassfrogDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceGlassfrog(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_glassfrog_resource.go b/internal/provider/source_glassfrog_resource.go index 562c8a747..84b173c01 100755 --- a/internal/provider/source_glassfrog_resource.go +++ b/internal/provider/source_glassfrog_resource.go @@ -143,6 +143,9 @@ func (r *SourceGlassfrogResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceGlassfrog(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceGlassfrogResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceGlassfrog(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceGlassfrogResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceGlassfrog(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceGlassfrogResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceGlassfrog(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceGlassfrogResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceGlassfrog(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_gnews_data_source.go b/internal/provider/source_gnews_data_source.go index b762edf44..7bdfff5b3 100755 --- a/internal/provider/source_gnews_data_source.go +++ b/internal/provider/source_gnews_data_source.go @@ -281,6 +281,9 @@ func (r *SourceGnewsDataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourceGnews(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_gnews_resource.go b/internal/provider/source_gnews_resource.go index 96436e7c9..0bdb34a5c 100755 --- a/internal/provider/source_gnews_resource.go +++ b/internal/provider/source_gnews_resource.go @@ -295,6 +295,9 @@ func (r *SourceGnewsResource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourceGnews(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -340,6 +343,9 @@ func (r *SourceGnewsResource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourceGnews(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -376,6 +382,9 @@ func (r *SourceGnewsResource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourceGnews(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -393,6 +402,9 @@ func (r *SourceGnewsResource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourceGnews(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -438,6 +450,9 @@ func (r *SourceGnewsResource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourceGnews(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googleads_data_source.go b/internal/provider/source_googleads_data_source.go index 24839c7c3..e04d61506 100755 --- a/internal/provider/source_googleads_data_source.go +++ b/internal/provider/source_googleads_data_source.go @@ -192,6 +192,9 @@ func (r *SourceGoogleAdsDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceGoogleAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googleads_resource.go b/internal/provider/source_googleads_resource.go index a3b7ae930..a44452123 100755 --- a/internal/provider/source_googleads_resource.go +++ b/internal/provider/source_googleads_resource.go @@ -206,6 +206,9 @@ func (r *SourceGoogleAdsResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceGoogleAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -251,6 +254,9 @@ func (r *SourceGoogleAdsResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceGoogleAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -287,6 +293,9 @@ func (r *SourceGoogleAdsResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceGoogleAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -304,6 +313,9 @@ func (r *SourceGoogleAdsResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceGoogleAds(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -349,6 +361,9 @@ func (r *SourceGoogleAdsResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceGoogleAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googleanalyticsdataapi_data_source.go b/internal/provider/source_googleanalyticsdataapi_data_source.go index 47dd4d222..4c6eabfa8 100755 --- a/internal/provider/source_googleanalyticsdataapi_data_source.go +++ b/internal/provider/source_googleanalyticsdataapi_data_source.go @@ -254,6 +254,9 @@ func (r *SourceGoogleAnalyticsDataAPIDataSource) Read(ctx context.Context, req d res, err := r.client.Sources.GetSourceGoogleAnalyticsDataAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googleanalyticsdataapi_resource.go b/internal/provider/source_googleanalyticsdataapi_resource.go index 2490618dd..ddbc1cd09 100755 --- a/internal/provider/source_googleanalyticsdataapi_resource.go +++ b/internal/provider/source_googleanalyticsdataapi_resource.go @@ -268,6 +268,9 @@ func (r *SourceGoogleAnalyticsDataAPIResource) Create(ctx context.Context, req r res, err := r.client.Sources.CreateSourceGoogleAnalyticsDataAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -313,6 +316,9 @@ func (r *SourceGoogleAnalyticsDataAPIResource) Read(ctx context.Context, req res res, err := r.client.Sources.GetSourceGoogleAnalyticsDataAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -349,6 +355,9 @@ func (r *SourceGoogleAnalyticsDataAPIResource) Update(ctx context.Context, req r res, err := r.client.Sources.PutSourceGoogleAnalyticsDataAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -366,6 +375,9 @@ func (r *SourceGoogleAnalyticsDataAPIResource) Update(ctx context.Context, req r getResponse, err := r.client.Sources.GetSourceGoogleAnalyticsDataAPI(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -411,6 +423,9 @@ func (r *SourceGoogleAnalyticsDataAPIResource) Delete(ctx context.Context, req r res, err := r.client.Sources.DeleteSourceGoogleAnalyticsDataAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googleanalyticsv4_data_source.go b/internal/provider/source_googleanalyticsv4_data_source.go index b8305d250..d90e312f8 100755 --- a/internal/provider/source_googleanalyticsv4_data_source.go +++ b/internal/provider/source_googleanalyticsv4_data_source.go @@ -251,6 +251,9 @@ func (r *SourceGoogleAnalyticsV4DataSource) Read(ctx context.Context, req dataso res, err := r.client.Sources.GetSourceGoogleAnalyticsV4(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googleanalyticsv4_resource.go b/internal/provider/source_googleanalyticsv4_resource.go index 00032293a..2c02e5f5d 100755 --- a/internal/provider/source_googleanalyticsv4_resource.go +++ b/internal/provider/source_googleanalyticsv4_resource.go @@ -265,6 +265,9 @@ func (r *SourceGoogleAnalyticsV4Resource) Create(ctx context.Context, req resour res, err := r.client.Sources.CreateSourceGoogleAnalyticsV4(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -310,6 +313,9 @@ func (r *SourceGoogleAnalyticsV4Resource) Read(ctx context.Context, req resource res, err := r.client.Sources.GetSourceGoogleAnalyticsV4(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -346,6 +352,9 @@ func (r *SourceGoogleAnalyticsV4Resource) Update(ctx context.Context, req resour res, err := r.client.Sources.PutSourceGoogleAnalyticsV4(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -363,6 +372,9 @@ func (r *SourceGoogleAnalyticsV4Resource) Update(ctx context.Context, req resour getResponse, err := r.client.Sources.GetSourceGoogleAnalyticsV4(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -408,6 +420,9 @@ func (r *SourceGoogleAnalyticsV4Resource) Delete(ctx context.Context, req resour res, err := r.client.Sources.DeleteSourceGoogleAnalyticsV4(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googledirectory_data_source.go b/internal/provider/source_googledirectory_data_source.go index a86476a69..0b24ef1c4 100755 --- a/internal/provider/source_googledirectory_data_source.go +++ b/internal/provider/source_googledirectory_data_source.go @@ -133,6 +133,9 @@ func (r *SourceGoogleDirectoryDataSource) Read(ctx context.Context, req datasour res, err := r.client.Sources.GetSourceGoogleDirectory(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googledirectory_resource.go b/internal/provider/source_googledirectory_resource.go index 03ae00a52..75f80a443 100755 --- a/internal/provider/source_googledirectory_resource.go +++ b/internal/provider/source_googledirectory_resource.go @@ -147,6 +147,9 @@ func (r *SourceGoogleDirectoryResource) Create(ctx context.Context, req resource res, err := r.client.Sources.CreateSourceGoogleDirectory(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourceGoogleDirectoryResource) Read(ctx context.Context, req resource.R res, err := r.client.Sources.GetSourceGoogleDirectory(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourceGoogleDirectoryResource) Update(ctx context.Context, req resource res, err := r.client.Sources.PutSourceGoogleDirectory(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourceGoogleDirectoryResource) Update(ctx context.Context, req resource getResponse, err := r.client.Sources.GetSourceGoogleDirectory(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourceGoogleDirectoryResource) Delete(ctx context.Context, req resource res, err := r.client.Sources.DeleteSourceGoogleDirectory(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googlepagespeedinsights_data_source.go b/internal/provider/source_googlepagespeedinsights_data_source.go index ecd84b98a..72a3406ee 100755 --- a/internal/provider/source_googlepagespeedinsights_data_source.go +++ b/internal/provider/source_googlepagespeedinsights_data_source.go @@ -144,6 +144,9 @@ func (r *SourceGooglePagespeedInsightsDataSource) Read(ctx context.Context, req res, err := r.client.Sources.GetSourceGooglePagespeedInsights(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googlepagespeedinsights_resource.go b/internal/provider/source_googlepagespeedinsights_resource.go index 286157de7..454532986 100755 --- a/internal/provider/source_googlepagespeedinsights_resource.go +++ b/internal/provider/source_googlepagespeedinsights_resource.go @@ -158,6 +158,9 @@ func (r *SourceGooglePagespeedInsightsResource) Create(ctx context.Context, req res, err := r.client.Sources.CreateSourceGooglePagespeedInsights(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -203,6 +206,9 @@ func (r *SourceGooglePagespeedInsightsResource) Read(ctx context.Context, req re res, err := r.client.Sources.GetSourceGooglePagespeedInsights(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -239,6 +245,9 @@ func (r *SourceGooglePagespeedInsightsResource) Update(ctx context.Context, req res, err := r.client.Sources.PutSourceGooglePagespeedInsights(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -256,6 +265,9 @@ func (r *SourceGooglePagespeedInsightsResource) Update(ctx context.Context, req getResponse, err := r.client.Sources.GetSourceGooglePagespeedInsights(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -301,6 +313,9 @@ func (r *SourceGooglePagespeedInsightsResource) Delete(ctx context.Context, req res, err := r.client.Sources.DeleteSourceGooglePagespeedInsights(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googlesearchconsole_data_source.go b/internal/provider/source_googlesearchconsole_data_source.go index 84d2043d2..d5e8ec934 100755 --- a/internal/provider/source_googlesearchconsole_data_source.go +++ b/internal/provider/source_googlesearchconsole_data_source.go @@ -272,6 +272,9 @@ func (r *SourceGoogleSearchConsoleDataSource) Read(ctx context.Context, req data res, err := r.client.Sources.GetSourceGoogleSearchConsole(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googlesearchconsole_resource.go b/internal/provider/source_googlesearchconsole_resource.go index 44e6e08b9..e493070d5 100755 --- a/internal/provider/source_googlesearchconsole_resource.go +++ b/internal/provider/source_googlesearchconsole_resource.go @@ -286,6 +286,9 @@ func (r *SourceGoogleSearchConsoleResource) Create(ctx context.Context, req reso res, err := r.client.Sources.CreateSourceGoogleSearchConsole(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -331,6 +334,9 @@ func (r *SourceGoogleSearchConsoleResource) Read(ctx context.Context, req resour res, err := r.client.Sources.GetSourceGoogleSearchConsole(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -367,6 +373,9 @@ func (r *SourceGoogleSearchConsoleResource) Update(ctx context.Context, req reso res, err := r.client.Sources.PutSourceGoogleSearchConsole(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -384,6 +393,9 @@ func (r *SourceGoogleSearchConsoleResource) Update(ctx context.Context, req reso getResponse, err := r.client.Sources.GetSourceGoogleSearchConsole(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -429,6 +441,9 @@ func (r *SourceGoogleSearchConsoleResource) Delete(ctx context.Context, req reso res, err := r.client.Sources.DeleteSourceGoogleSearchConsole(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googlesheets_data_source.go b/internal/provider/source_googlesheets_data_source.go index 50547b4be..6f935d77d 100755 --- a/internal/provider/source_googlesheets_data_source.go +++ b/internal/provider/source_googlesheets_data_source.go @@ -235,6 +235,9 @@ func (r *SourceGoogleSheetsDataSource) Read(ctx context.Context, req datasource. res, err := r.client.Sources.GetSourceGoogleSheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googlesheets_resource.go b/internal/provider/source_googlesheets_resource.go index 276f06a97..f6d541fab 100755 --- a/internal/provider/source_googlesheets_resource.go +++ b/internal/provider/source_googlesheets_resource.go @@ -249,6 +249,9 @@ func (r *SourceGoogleSheetsResource) Create(ctx context.Context, req resource.Cr res, err := r.client.Sources.CreateSourceGoogleSheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -294,6 +297,9 @@ func (r *SourceGoogleSheetsResource) Read(ctx context.Context, req resource.Read res, err := r.client.Sources.GetSourceGoogleSheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -330,6 +336,9 @@ func (r *SourceGoogleSheetsResource) Update(ctx context.Context, req resource.Up res, err := r.client.Sources.PutSourceGoogleSheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -347,6 +356,9 @@ func (r *SourceGoogleSheetsResource) Update(ctx context.Context, req resource.Up getResponse, err := r.client.Sources.GetSourceGoogleSheets(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -392,6 +404,9 @@ func (r *SourceGoogleSheetsResource) Delete(ctx context.Context, req resource.De res, err := r.client.Sources.DeleteSourceGoogleSheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googlewebfonts_data_source.go b/internal/provider/source_googlewebfonts_data_source.go index 284ffdc61..d1e5544f8 100755 --- a/internal/provider/source_googlewebfonts_data_source.go +++ b/internal/provider/source_googlewebfonts_data_source.go @@ -141,6 +141,9 @@ func (r *SourceGoogleWebfontsDataSource) Read(ctx context.Context, req datasourc res, err := r.client.Sources.GetSourceGoogleWebfonts(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googlewebfonts_resource.go b/internal/provider/source_googlewebfonts_resource.go index 4bb4cda16..03ce4bb72 100755 --- a/internal/provider/source_googlewebfonts_resource.go +++ b/internal/provider/source_googlewebfonts_resource.go @@ -155,6 +155,9 @@ func (r *SourceGoogleWebfontsResource) Create(ctx context.Context, req resource. res, err := r.client.Sources.CreateSourceGoogleWebfonts(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -200,6 +203,9 @@ func (r *SourceGoogleWebfontsResource) Read(ctx context.Context, req resource.Re res, err := r.client.Sources.GetSourceGoogleWebfonts(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -236,6 +242,9 @@ func (r *SourceGoogleWebfontsResource) Update(ctx context.Context, req resource. res, err := r.client.Sources.PutSourceGoogleWebfonts(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +262,9 @@ func (r *SourceGoogleWebfontsResource) Update(ctx context.Context, req resource. getResponse, err := r.client.Sources.GetSourceGoogleWebfonts(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -298,6 +310,9 @@ func (r *SourceGoogleWebfontsResource) Delete(ctx context.Context, req resource. res, err := r.client.Sources.DeleteSourceGoogleWebfonts(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googleworkspaceadminreports_data_source.go b/internal/provider/source_googleworkspaceadminreports_data_source.go index 872e2d6ed..358cb284c 100755 --- a/internal/provider/source_googleworkspaceadminreports_data_source.go +++ b/internal/provider/source_googleworkspaceadminreports_data_source.go @@ -137,6 +137,9 @@ func (r *SourceGoogleWorkspaceAdminReportsDataSource) Read(ctx context.Context, res, err := r.client.Sources.GetSourceGoogleWorkspaceAdminReports(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_googleworkspaceadminreports_resource.go b/internal/provider/source_googleworkspaceadminreports_resource.go index 5707f2e4b..5b4c0522d 100755 --- a/internal/provider/source_googleworkspaceadminreports_resource.go +++ b/internal/provider/source_googleworkspaceadminreports_resource.go @@ -151,6 +151,9 @@ func (r *SourceGoogleWorkspaceAdminReportsResource) Create(ctx context.Context, res, err := r.client.Sources.CreateSourceGoogleWorkspaceAdminReports(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceGoogleWorkspaceAdminReportsResource) Read(ctx context.Context, re res, err := r.client.Sources.GetSourceGoogleWorkspaceAdminReports(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceGoogleWorkspaceAdminReportsResource) Update(ctx context.Context, res, err := r.client.Sources.PutSourceGoogleWorkspaceAdminReports(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceGoogleWorkspaceAdminReportsResource) Update(ctx context.Context, getResponse, err := r.client.Sources.GetSourceGoogleWorkspaceAdminReports(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceGoogleWorkspaceAdminReportsResource) Delete(ctx context.Context, res, err := r.client.Sources.DeleteSourceGoogleWorkspaceAdminReports(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_greenhouse_data_source.go b/internal/provider/source_greenhouse_data_source.go index 5f462b54a..f1a1cd16d 100755 --- a/internal/provider/source_greenhouse_data_source.go +++ b/internal/provider/source_greenhouse_data_source.go @@ -129,6 +129,9 @@ func (r *SourceGreenhouseDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceGreenhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_greenhouse_resource.go b/internal/provider/source_greenhouse_resource.go index 118962f4e..a1af73ad9 100755 --- a/internal/provider/source_greenhouse_resource.go +++ b/internal/provider/source_greenhouse_resource.go @@ -143,6 +143,9 @@ func (r *SourceGreenhouseResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceGreenhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceGreenhouseResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceGreenhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceGreenhouseResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceGreenhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceGreenhouseResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceGreenhouse(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceGreenhouseResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceGreenhouse(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_gridly_data_source.go b/internal/provider/source_gridly_data_source.go index 7f6097c86..2f42ffcb7 100755 --- a/internal/provider/source_gridly_data_source.go +++ b/internal/provider/source_gridly_data_source.go @@ -132,6 +132,9 @@ func (r *SourceGridlyDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceGridly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_gridly_resource.go b/internal/provider/source_gridly_resource.go index cd98d5ba9..1606d8ddf 100755 --- a/internal/provider/source_gridly_resource.go +++ b/internal/provider/source_gridly_resource.go @@ -146,6 +146,9 @@ func (r *SourceGridlyResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceGridly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -191,6 +194,9 @@ func (r *SourceGridlyResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceGridly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -227,6 +233,9 @@ func (r *SourceGridlyResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceGridly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +253,9 @@ func (r *SourceGridlyResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceGridly(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -289,6 +301,9 @@ func (r *SourceGridlyResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceGridly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_harvest_data_source.go b/internal/provider/source_harvest_data_source.go index 5134c3ba1..7bfeb0f59 100755 --- a/internal/provider/source_harvest_data_source.go +++ b/internal/provider/source_harvest_data_source.go @@ -273,6 +273,9 @@ func (r *SourceHarvestDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceHarvest(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_harvest_resource.go b/internal/provider/source_harvest_resource.go index 0e63b704b..57a301110 100755 --- a/internal/provider/source_harvest_resource.go +++ b/internal/provider/source_harvest_resource.go @@ -287,6 +287,9 @@ func (r *SourceHarvestResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceHarvest(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -332,6 +335,9 @@ func (r *SourceHarvestResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceHarvest(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -368,6 +374,9 @@ func (r *SourceHarvestResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceHarvest(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -385,6 +394,9 @@ func (r *SourceHarvestResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceHarvest(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -430,6 +442,9 @@ func (r *SourceHarvestResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceHarvest(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_hubplanner_data_source.go b/internal/provider/source_hubplanner_data_source.go index 5c450501f..ce9c4267f 100755 --- a/internal/provider/source_hubplanner_data_source.go +++ b/internal/provider/source_hubplanner_data_source.go @@ -129,6 +129,9 @@ func (r *SourceHubplannerDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceHubplanner(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_hubplanner_resource.go b/internal/provider/source_hubplanner_resource.go index 29362cf3d..92e2e30ce 100755 --- a/internal/provider/source_hubplanner_resource.go +++ b/internal/provider/source_hubplanner_resource.go @@ -143,6 +143,9 @@ func (r *SourceHubplannerResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceHubplanner(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceHubplannerResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceHubplanner(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceHubplannerResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceHubplanner(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceHubplannerResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceHubplanner(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceHubplannerResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceHubplanner(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_hubspot_data_source.go b/internal/provider/source_hubspot_data_source.go index 2e9c7fd8b..98d6207bb 100755 --- a/internal/provider/source_hubspot_data_source.go +++ b/internal/provider/source_hubspot_data_source.go @@ -238,6 +238,9 @@ func (r *SourceHubspotDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceHubspot(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_hubspot_resource.go b/internal/provider/source_hubspot_resource.go index 4fdec7e8f..39d051974 100755 --- a/internal/provider/source_hubspot_resource.go +++ b/internal/provider/source_hubspot_resource.go @@ -252,6 +252,9 @@ func (r *SourceHubspotResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceHubspot(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -297,6 +300,9 @@ func (r *SourceHubspotResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceHubspot(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -333,6 +339,9 @@ func (r *SourceHubspotResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceHubspot(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -350,6 +359,9 @@ func (r *SourceHubspotResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceHubspot(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -395,6 +407,9 @@ func (r *SourceHubspotResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceHubspot(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_insightly_data_source.go b/internal/provider/source_insightly_data_source.go index eaadc5b29..7649c42e6 100755 --- a/internal/provider/source_insightly_data_source.go +++ b/internal/provider/source_insightly_data_source.go @@ -133,6 +133,9 @@ func (r *SourceInsightlyDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceInsightly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_insightly_resource.go b/internal/provider/source_insightly_resource.go index 98b221a8d..cc256d6a6 100755 --- a/internal/provider/source_insightly_resource.go +++ b/internal/provider/source_insightly_resource.go @@ -147,6 +147,9 @@ func (r *SourceInsightlyResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceInsightly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourceInsightlyResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceInsightly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourceInsightlyResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceInsightly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourceInsightlyResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceInsightly(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourceInsightlyResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceInsightly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_instagram_data_source.go b/internal/provider/source_instagram_data_source.go index 6f533b3c6..71717fda4 100755 --- a/internal/provider/source_instagram_data_source.go +++ b/internal/provider/source_instagram_data_source.go @@ -137,6 +137,9 @@ func (r *SourceInstagramDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceInstagram(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_instagram_resource.go b/internal/provider/source_instagram_resource.go index 54def8e47..e1caea90c 100755 --- a/internal/provider/source_instagram_resource.go +++ b/internal/provider/source_instagram_resource.go @@ -151,6 +151,9 @@ func (r *SourceInstagramResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceInstagram(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceInstagramResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceInstagram(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceInstagramResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceInstagram(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceInstagramResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceInstagram(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceInstagramResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceInstagram(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_instatus_data_source.go b/internal/provider/source_instatus_data_source.go index 62d33d2cb..3ee64abca 100755 --- a/internal/provider/source_instatus_data_source.go +++ b/internal/provider/source_instatus_data_source.go @@ -129,6 +129,9 @@ func (r *SourceInstatusDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceInstatus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_instatus_resource.go b/internal/provider/source_instatus_resource.go index a2cf4932a..dd3fbf349 100755 --- a/internal/provider/source_instatus_resource.go +++ b/internal/provider/source_instatus_resource.go @@ -143,6 +143,9 @@ func (r *SourceInstatusResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceInstatus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceInstatusResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceInstatus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceInstatusResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceInstatus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceInstatusResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceInstatus(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceInstatusResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceInstatus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_intercom_data_source.go b/internal/provider/source_intercom_data_source.go index fc8a191ee..98e8886cc 100755 --- a/internal/provider/source_intercom_data_source.go +++ b/internal/provider/source_intercom_data_source.go @@ -137,6 +137,9 @@ func (r *SourceIntercomDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceIntercom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_intercom_resource.go b/internal/provider/source_intercom_resource.go index 304f5fca9..6cecdefaf 100755 --- a/internal/provider/source_intercom_resource.go +++ b/internal/provider/source_intercom_resource.go @@ -151,6 +151,9 @@ func (r *SourceIntercomResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceIntercom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceIntercomResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceIntercom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceIntercomResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceIntercom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceIntercomResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceIntercom(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceIntercomResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceIntercom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_ip2whois_data_source.go b/internal/provider/source_ip2whois_data_source.go index 7c2e70897..cbbc7dd5e 100755 --- a/internal/provider/source_ip2whois_data_source.go +++ b/internal/provider/source_ip2whois_data_source.go @@ -133,6 +133,9 @@ func (r *SourceIp2whoisDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceIp2whois(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_ip2whois_resource.go b/internal/provider/source_ip2whois_resource.go index c04f88ab2..a94d1b559 100755 --- a/internal/provider/source_ip2whois_resource.go +++ b/internal/provider/source_ip2whois_resource.go @@ -147,6 +147,9 @@ func (r *SourceIp2whoisResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceIp2whois(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourceIp2whoisResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceIp2whois(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourceIp2whoisResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceIp2whois(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourceIp2whoisResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceIp2whois(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourceIp2whoisResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceIp2whois(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_iterable_data_source.go b/internal/provider/source_iterable_data_source.go index 7b8d04fb7..e8bd496a6 100755 --- a/internal/provider/source_iterable_data_source.go +++ b/internal/provider/source_iterable_data_source.go @@ -137,6 +137,9 @@ func (r *SourceIterableDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceIterable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_iterable_resource.go b/internal/provider/source_iterable_resource.go index fed53648a..246d329d4 100755 --- a/internal/provider/source_iterable_resource.go +++ b/internal/provider/source_iterable_resource.go @@ -151,6 +151,9 @@ func (r *SourceIterableResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceIterable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceIterableResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceIterable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceIterableResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceIterable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceIterableResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceIterable(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceIterableResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceIterable(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_jira_data_source.go b/internal/provider/source_jira_data_source.go index 68f10b379..aaacbfaeb 100755 --- a/internal/provider/source_jira_data_source.go +++ b/internal/provider/source_jira_data_source.go @@ -162,6 +162,9 @@ func (r *SourceJiraDataSource) Read(ctx context.Context, req datasource.ReadRequ res, err := r.client.Sources.GetSourceJira(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_jira_resource.go b/internal/provider/source_jira_resource.go index d1eeae34a..24c5a00f1 100755 --- a/internal/provider/source_jira_resource.go +++ b/internal/provider/source_jira_resource.go @@ -176,6 +176,9 @@ func (r *SourceJiraResource) Create(ctx context.Context, req resource.CreateRequ res, err := r.client.Sources.CreateSourceJira(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -221,6 +224,9 @@ func (r *SourceJiraResource) Read(ctx context.Context, req resource.ReadRequest, res, err := r.client.Sources.GetSourceJira(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -257,6 +263,9 @@ func (r *SourceJiraResource) Update(ctx context.Context, req resource.UpdateRequ res, err := r.client.Sources.PutSourceJira(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -274,6 +283,9 @@ func (r *SourceJiraResource) Update(ctx context.Context, req resource.UpdateRequ getResponse, err := r.client.Sources.GetSourceJira(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -319,6 +331,9 @@ func (r *SourceJiraResource) Delete(ctx context.Context, req resource.DeleteRequ res, err := r.client.Sources.DeleteSourceJira(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_k6cloud_data_source.go b/internal/provider/source_k6cloud_data_source.go index 44dbfc9d4..7b8bc5616 100755 --- a/internal/provider/source_k6cloud_data_source.go +++ b/internal/provider/source_k6cloud_data_source.go @@ -129,6 +129,9 @@ func (r *SourceK6CloudDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceK6Cloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_k6cloud_resource.go b/internal/provider/source_k6cloud_resource.go index 510273b79..411c8af22 100755 --- a/internal/provider/source_k6cloud_resource.go +++ b/internal/provider/source_k6cloud_resource.go @@ -143,6 +143,9 @@ func (r *SourceK6CloudResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceK6Cloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceK6CloudResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceK6Cloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceK6CloudResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceK6Cloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceK6CloudResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceK6Cloud(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceK6CloudResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceK6Cloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_klarna_data_source.go b/internal/provider/source_klarna_data_source.go index f702dcd9e..e1444a5a6 100755 --- a/internal/provider/source_klarna_data_source.go +++ b/internal/provider/source_klarna_data_source.go @@ -149,6 +149,9 @@ func (r *SourceKlarnaDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceKlarna(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_klarna_resource.go b/internal/provider/source_klarna_resource.go index b8790391a..c609523ca 100755 --- a/internal/provider/source_klarna_resource.go +++ b/internal/provider/source_klarna_resource.go @@ -163,6 +163,9 @@ func (r *SourceKlarnaResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceKlarna(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -208,6 +211,9 @@ func (r *SourceKlarnaResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceKlarna(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +250,9 @@ func (r *SourceKlarnaResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceKlarna(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -261,6 +270,9 @@ func (r *SourceKlarnaResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceKlarna(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -306,6 +318,9 @@ func (r *SourceKlarnaResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceKlarna(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_klaviyo_data_source.go b/internal/provider/source_klaviyo_data_source.go index ba014d731..0400255d1 100755 --- a/internal/provider/source_klaviyo_data_source.go +++ b/internal/provider/source_klaviyo_data_source.go @@ -137,6 +137,9 @@ func (r *SourceKlaviyoDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceKlaviyo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_klaviyo_resource.go b/internal/provider/source_klaviyo_resource.go index c0eb07106..e6cdcd8d0 100755 --- a/internal/provider/source_klaviyo_resource.go +++ b/internal/provider/source_klaviyo_resource.go @@ -151,6 +151,9 @@ func (r *SourceKlaviyoResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceKlaviyo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceKlaviyoResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceKlaviyo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceKlaviyoResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceKlaviyo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceKlaviyoResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceKlaviyo(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceKlaviyoResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceKlaviyo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_kustomersinger_data_source.go b/internal/provider/source_kustomersinger_data_source.go index 81c623614..0ce09811c 100755 --- a/internal/provider/source_kustomersinger_data_source.go +++ b/internal/provider/source_kustomersinger_data_source.go @@ -133,6 +133,9 @@ func (r *SourceKustomerSingerDataSource) Read(ctx context.Context, req datasourc res, err := r.client.Sources.GetSourceKustomerSinger(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_kustomersinger_resource.go b/internal/provider/source_kustomersinger_resource.go index 3ee2e6eb5..792230c4d 100755 --- a/internal/provider/source_kustomersinger_resource.go +++ b/internal/provider/source_kustomersinger_resource.go @@ -147,6 +147,9 @@ func (r *SourceKustomerSingerResource) Create(ctx context.Context, req resource. res, err := r.client.Sources.CreateSourceKustomerSinger(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourceKustomerSingerResource) Read(ctx context.Context, req resource.Re res, err := r.client.Sources.GetSourceKustomerSinger(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourceKustomerSingerResource) Update(ctx context.Context, req resource. res, err := r.client.Sources.PutSourceKustomerSinger(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourceKustomerSingerResource) Update(ctx context.Context, req resource. getResponse, err := r.client.Sources.GetSourceKustomerSinger(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourceKustomerSingerResource) Delete(ctx context.Context, req resource. res, err := r.client.Sources.DeleteSourceKustomerSinger(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_launchdarkly_data_source.go b/internal/provider/source_launchdarkly_data_source.go index adccfbfff..6a934e1e6 100755 --- a/internal/provider/source_launchdarkly_data_source.go +++ b/internal/provider/source_launchdarkly_data_source.go @@ -129,6 +129,9 @@ func (r *SourceLaunchdarklyDataSource) Read(ctx context.Context, req datasource. res, err := r.client.Sources.GetSourceLaunchdarkly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_launchdarkly_resource.go b/internal/provider/source_launchdarkly_resource.go index 4172c6776..c83eeaa95 100755 --- a/internal/provider/source_launchdarkly_resource.go +++ b/internal/provider/source_launchdarkly_resource.go @@ -143,6 +143,9 @@ func (r *SourceLaunchdarklyResource) Create(ctx context.Context, req resource.Cr res, err := r.client.Sources.CreateSourceLaunchdarkly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceLaunchdarklyResource) Read(ctx context.Context, req resource.Read res, err := r.client.Sources.GetSourceLaunchdarkly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceLaunchdarklyResource) Update(ctx context.Context, req resource.Up res, err := r.client.Sources.PutSourceLaunchdarkly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceLaunchdarklyResource) Update(ctx context.Context, req resource.Up getResponse, err := r.client.Sources.GetSourceLaunchdarkly(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceLaunchdarklyResource) Delete(ctx context.Context, req resource.De res, err := r.client.Sources.DeleteSourceLaunchdarkly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_lemlist_data_source.go b/internal/provider/source_lemlist_data_source.go index 301734ea8..0f44638a7 100755 --- a/internal/provider/source_lemlist_data_source.go +++ b/internal/provider/source_lemlist_data_source.go @@ -129,6 +129,9 @@ func (r *SourceLemlistDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceLemlist(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_lemlist_resource.go b/internal/provider/source_lemlist_resource.go index 2a4330cbe..1b098f290 100755 --- a/internal/provider/source_lemlist_resource.go +++ b/internal/provider/source_lemlist_resource.go @@ -143,6 +143,9 @@ func (r *SourceLemlistResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceLemlist(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceLemlistResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceLemlist(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceLemlistResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceLemlist(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceLemlistResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceLemlist(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceLemlistResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceLemlist(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_linkedinads_data_source.go b/internal/provider/source_linkedinads_data_source.go index 100b2850a..9dee0fe82 100755 --- a/internal/provider/source_linkedinads_data_source.go +++ b/internal/provider/source_linkedinads_data_source.go @@ -234,6 +234,9 @@ func (r *SourceLinkedinAdsDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Sources.GetSourceLinkedinAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_linkedinads_resource.go b/internal/provider/source_linkedinads_resource.go index 718d2a43a..278c8fe86 100755 --- a/internal/provider/source_linkedinads_resource.go +++ b/internal/provider/source_linkedinads_resource.go @@ -248,6 +248,9 @@ func (r *SourceLinkedinAdsResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Sources.CreateSourceLinkedinAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -293,6 +296,9 @@ func (r *SourceLinkedinAdsResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Sources.GetSourceLinkedinAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -329,6 +335,9 @@ func (r *SourceLinkedinAdsResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Sources.PutSourceLinkedinAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -346,6 +355,9 @@ func (r *SourceLinkedinAdsResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Sources.GetSourceLinkedinAds(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -391,6 +403,9 @@ func (r *SourceLinkedinAdsResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Sources.DeleteSourceLinkedinAds(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_linkedinpages_data_source.go b/internal/provider/source_linkedinpages_data_source.go index 16e435230..4086a1ea3 100755 --- a/internal/provider/source_linkedinpages_data_source.go +++ b/internal/provider/source_linkedinpages_data_source.go @@ -226,6 +226,9 @@ func (r *SourceLinkedinPagesDataSource) Read(ctx context.Context, req datasource res, err := r.client.Sources.GetSourceLinkedinPages(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_linkedinpages_resource.go b/internal/provider/source_linkedinpages_resource.go index f3ecf1734..cbb822cd2 100755 --- a/internal/provider/source_linkedinpages_resource.go +++ b/internal/provider/source_linkedinpages_resource.go @@ -240,6 +240,9 @@ func (r *SourceLinkedinPagesResource) Create(ctx context.Context, req resource.C res, err := r.client.Sources.CreateSourceLinkedinPages(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -285,6 +288,9 @@ func (r *SourceLinkedinPagesResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Sources.GetSourceLinkedinPages(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -321,6 +327,9 @@ func (r *SourceLinkedinPagesResource) Update(ctx context.Context, req resource.U res, err := r.client.Sources.PutSourceLinkedinPages(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -338,6 +347,9 @@ func (r *SourceLinkedinPagesResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Sources.GetSourceLinkedinPages(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -383,6 +395,9 @@ func (r *SourceLinkedinPagesResource) Delete(ctx context.Context, req resource.D res, err := r.client.Sources.DeleteSourceLinkedinPages(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_linnworks_data_source.go b/internal/provider/source_linnworks_data_source.go index 1dab0ed96..9e5c7e90c 100755 --- a/internal/provider/source_linnworks_data_source.go +++ b/internal/provider/source_linnworks_data_source.go @@ -144,6 +144,9 @@ func (r *SourceLinnworksDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceLinnworks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_linnworks_resource.go b/internal/provider/source_linnworks_resource.go index ff51084cc..e892f34bf 100755 --- a/internal/provider/source_linnworks_resource.go +++ b/internal/provider/source_linnworks_resource.go @@ -158,6 +158,9 @@ func (r *SourceLinnworksResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceLinnworks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -203,6 +206,9 @@ func (r *SourceLinnworksResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceLinnworks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -239,6 +245,9 @@ func (r *SourceLinnworksResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceLinnworks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -256,6 +265,9 @@ func (r *SourceLinnworksResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceLinnworks(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -301,6 +313,9 @@ func (r *SourceLinnworksResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceLinnworks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_lokalise_data_source.go b/internal/provider/source_lokalise_data_source.go index 891ba1fa8..fe1e24c68 100755 --- a/internal/provider/source_lokalise_data_source.go +++ b/internal/provider/source_lokalise_data_source.go @@ -133,6 +133,9 @@ func (r *SourceLokaliseDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceLokalise(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_lokalise_resource.go b/internal/provider/source_lokalise_resource.go index 0a026e6d0..58a8e7161 100755 --- a/internal/provider/source_lokalise_resource.go +++ b/internal/provider/source_lokalise_resource.go @@ -147,6 +147,9 @@ func (r *SourceLokaliseResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceLokalise(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourceLokaliseResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceLokalise(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourceLokaliseResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceLokalise(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourceLokaliseResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceLokalise(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourceLokaliseResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceLokalise(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_mailchimp_data_source.go b/internal/provider/source_mailchimp_data_source.go index f7982b4e8..f82f09404 100755 --- a/internal/provider/source_mailchimp_data_source.go +++ b/internal/provider/source_mailchimp_data_source.go @@ -225,6 +225,9 @@ func (r *SourceMailchimpDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceMailchimp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_mailchimp_resource.go b/internal/provider/source_mailchimp_resource.go index fdb5c801a..dd6b29dd8 100755 --- a/internal/provider/source_mailchimp_resource.go +++ b/internal/provider/source_mailchimp_resource.go @@ -239,6 +239,9 @@ func (r *SourceMailchimpResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceMailchimp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -284,6 +287,9 @@ func (r *SourceMailchimpResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceMailchimp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -320,6 +326,9 @@ func (r *SourceMailchimpResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceMailchimp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -337,6 +346,9 @@ func (r *SourceMailchimpResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceMailchimp(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -382,6 +394,9 @@ func (r *SourceMailchimpResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceMailchimp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_mailgun_data_source.go b/internal/provider/source_mailgun_data_source.go index 5382d058f..7e8bf062a 100755 --- a/internal/provider/source_mailgun_data_source.go +++ b/internal/provider/source_mailgun_data_source.go @@ -141,6 +141,9 @@ func (r *SourceMailgunDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceMailgun(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_mailgun_resource.go b/internal/provider/source_mailgun_resource.go index 29a54bfec..8581e85a9 100755 --- a/internal/provider/source_mailgun_resource.go +++ b/internal/provider/source_mailgun_resource.go @@ -155,6 +155,9 @@ func (r *SourceMailgunResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceMailgun(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -200,6 +203,9 @@ func (r *SourceMailgunResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceMailgun(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -236,6 +242,9 @@ func (r *SourceMailgunResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceMailgun(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +262,9 @@ func (r *SourceMailgunResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceMailgun(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -298,6 +310,9 @@ func (r *SourceMailgunResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceMailgun(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_mailjetsms_data_source.go b/internal/provider/source_mailjetsms_data_source.go index 1a6f63b6a..05a857404 100755 --- a/internal/provider/source_mailjetsms_data_source.go +++ b/internal/provider/source_mailjetsms_data_source.go @@ -137,6 +137,9 @@ func (r *SourceMailjetSmsDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceMailjetSms(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_mailjetsms_resource.go b/internal/provider/source_mailjetsms_resource.go index 7854df0e9..bf87daebf 100755 --- a/internal/provider/source_mailjetsms_resource.go +++ b/internal/provider/source_mailjetsms_resource.go @@ -151,6 +151,9 @@ func (r *SourceMailjetSmsResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceMailjetSms(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceMailjetSmsResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceMailjetSms(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceMailjetSmsResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceMailjetSms(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceMailjetSmsResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceMailjetSms(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceMailjetSmsResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceMailjetSms(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_marketo_data_source.go b/internal/provider/source_marketo_data_source.go index 56c04b2c6..7fb1f386c 100755 --- a/internal/provider/source_marketo_data_source.go +++ b/internal/provider/source_marketo_data_source.go @@ -145,6 +145,9 @@ func (r *SourceMarketoDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceMarketo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_marketo_resource.go b/internal/provider/source_marketo_resource.go index d37cbe210..dc4e4edef 100755 --- a/internal/provider/source_marketo_resource.go +++ b/internal/provider/source_marketo_resource.go @@ -159,6 +159,9 @@ func (r *SourceMarketoResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceMarketo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -204,6 +207,9 @@ func (r *SourceMarketoResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceMarketo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +246,9 @@ func (r *SourceMarketoResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceMarketo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -257,6 +266,9 @@ func (r *SourceMarketoResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceMarketo(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -302,6 +314,9 @@ func (r *SourceMarketoResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceMarketo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_metabase_data_source.go b/internal/provider/source_metabase_data_source.go index 4d50d51f9..e4d597e12 100755 --- a/internal/provider/source_metabase_data_source.go +++ b/internal/provider/source_metabase_data_source.go @@ -144,6 +144,9 @@ func (r *SourceMetabaseDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceMetabase(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_metabase_resource.go b/internal/provider/source_metabase_resource.go index 3a4a0e52e..8bd636f66 100755 --- a/internal/provider/source_metabase_resource.go +++ b/internal/provider/source_metabase_resource.go @@ -158,6 +158,9 @@ func (r *SourceMetabaseResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceMetabase(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -203,6 +206,9 @@ func (r *SourceMetabaseResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceMetabase(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -239,6 +245,9 @@ func (r *SourceMetabaseResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceMetabase(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -256,6 +265,9 @@ func (r *SourceMetabaseResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceMetabase(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -301,6 +313,9 @@ func (r *SourceMetabaseResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceMetabase(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_microsoftteams_data_source.go b/internal/provider/source_microsoftteams_data_source.go index 7efdd89bc..1b0ba90c1 100755 --- a/internal/provider/source_microsoftteams_data_source.go +++ b/internal/provider/source_microsoftteams_data_source.go @@ -255,6 +255,9 @@ func (r *SourceMicrosoftTeamsDataSource) Read(ctx context.Context, req datasourc res, err := r.client.Sources.GetSourceMicrosoftTeams(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_microsoftteams_resource.go b/internal/provider/source_microsoftteams_resource.go index 07f5fb498..ead9a62d0 100755 --- a/internal/provider/source_microsoftteams_resource.go +++ b/internal/provider/source_microsoftteams_resource.go @@ -269,6 +269,9 @@ func (r *SourceMicrosoftTeamsResource) Create(ctx context.Context, req resource. res, err := r.client.Sources.CreateSourceMicrosoftTeams(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -314,6 +317,9 @@ func (r *SourceMicrosoftTeamsResource) Read(ctx context.Context, req resource.Re res, err := r.client.Sources.GetSourceMicrosoftTeams(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -350,6 +356,9 @@ func (r *SourceMicrosoftTeamsResource) Update(ctx context.Context, req resource. res, err := r.client.Sources.PutSourceMicrosoftTeams(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -367,6 +376,9 @@ func (r *SourceMicrosoftTeamsResource) Update(ctx context.Context, req resource. getResponse, err := r.client.Sources.GetSourceMicrosoftTeams(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -412,6 +424,9 @@ func (r *SourceMicrosoftTeamsResource) Delete(ctx context.Context, req resource. res, err := r.client.Sources.DeleteSourceMicrosoftTeams(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_mixpanel_data_source.go b/internal/provider/source_mixpanel_data_source.go index 1fdb4b75a..ab9d5879b 100755 --- a/internal/provider/source_mixpanel_data_source.go +++ b/internal/provider/source_mixpanel_data_source.go @@ -264,6 +264,9 @@ func (r *SourceMixpanelDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceMixpanel(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_mixpanel_resource.go b/internal/provider/source_mixpanel_resource.go index c47410f01..e223a6d89 100755 --- a/internal/provider/source_mixpanel_resource.go +++ b/internal/provider/source_mixpanel_resource.go @@ -278,6 +278,9 @@ func (r *SourceMixpanelResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceMixpanel(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -323,6 +326,9 @@ func (r *SourceMixpanelResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceMixpanel(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -359,6 +365,9 @@ func (r *SourceMixpanelResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceMixpanel(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -376,6 +385,9 @@ func (r *SourceMixpanelResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceMixpanel(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -421,6 +433,9 @@ func (r *SourceMixpanelResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceMixpanel(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_monday_data_source.go b/internal/provider/source_monday_data_source.go index c3d23833a..ecbc54cb8 100755 --- a/internal/provider/source_monday_data_source.go +++ b/internal/provider/source_monday_data_source.go @@ -230,6 +230,9 @@ func (r *SourceMondayDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceMonday(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_monday_resource.go b/internal/provider/source_monday_resource.go index 5fc379965..ddbee89f3 100755 --- a/internal/provider/source_monday_resource.go +++ b/internal/provider/source_monday_resource.go @@ -244,6 +244,9 @@ func (r *SourceMondayResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceMonday(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -289,6 +292,9 @@ func (r *SourceMondayResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceMonday(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -325,6 +331,9 @@ func (r *SourceMondayResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceMonday(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -342,6 +351,9 @@ func (r *SourceMondayResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceMonday(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -387,6 +399,9 @@ func (r *SourceMondayResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceMonday(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_mongodb_data_source.go b/internal/provider/source_mongodb_data_source.go index e99857df0..3e58ed998 100755 --- a/internal/provider/source_mongodb_data_source.go +++ b/internal/provider/source_mongodb_data_source.go @@ -281,6 +281,9 @@ func (r *SourceMongodbDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceMongodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_mongodb_resource.go b/internal/provider/source_mongodb_resource.go index 8e59a7af1..c8e8a7aba 100755 --- a/internal/provider/source_mongodb_resource.go +++ b/internal/provider/source_mongodb_resource.go @@ -295,6 +295,9 @@ func (r *SourceMongodbResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceMongodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -340,6 +343,9 @@ func (r *SourceMongodbResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceMongodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -376,6 +382,9 @@ func (r *SourceMongodbResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceMongodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -393,6 +402,9 @@ func (r *SourceMongodbResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceMongodb(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -438,6 +450,9 @@ func (r *SourceMongodbResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceMongodb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_mssql_data_source.go b/internal/provider/source_mssql_data_source.go index e042b8e70..3c04acbac 100755 --- a/internal/provider/source_mssql_data_source.go +++ b/internal/provider/source_mssql_data_source.go @@ -522,6 +522,9 @@ func (r *SourceMssqlDataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourceMssql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_mssql_resource.go b/internal/provider/source_mssql_resource.go index 203662ef2..3af7e90b7 100755 --- a/internal/provider/source_mssql_resource.go +++ b/internal/provider/source_mssql_resource.go @@ -536,6 +536,9 @@ func (r *SourceMssqlResource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourceMssql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -581,6 +584,9 @@ func (r *SourceMssqlResource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourceMssql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -617,6 +623,9 @@ func (r *SourceMssqlResource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourceMssql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -634,6 +643,9 @@ func (r *SourceMssqlResource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourceMssql(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -679,6 +691,9 @@ func (r *SourceMssqlResource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourceMssql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_myhours_data_source.go b/internal/provider/source_myhours_data_source.go index a31cc6310..3d371a099 100755 --- a/internal/provider/source_myhours_data_source.go +++ b/internal/provider/source_myhours_data_source.go @@ -141,6 +141,9 @@ func (r *SourceMyHoursDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceMyHours(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_myhours_resource.go b/internal/provider/source_myhours_resource.go index b3e61d84d..3cfdaac28 100755 --- a/internal/provider/source_myhours_resource.go +++ b/internal/provider/source_myhours_resource.go @@ -155,6 +155,9 @@ func (r *SourceMyHoursResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceMyHours(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -200,6 +203,9 @@ func (r *SourceMyHoursResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceMyHours(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -236,6 +242,9 @@ func (r *SourceMyHoursResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceMyHours(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +262,9 @@ func (r *SourceMyHoursResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceMyHours(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -298,6 +310,9 @@ func (r *SourceMyHoursResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceMyHours(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_mysql_data_source.go b/internal/provider/source_mysql_data_source.go index 155ecfe49..ac02b1fa2 100755 --- a/internal/provider/source_mysql_data_source.go +++ b/internal/provider/source_mysql_data_source.go @@ -597,6 +597,9 @@ func (r *SourceMysqlDataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourceMysql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_mysql_resource.go b/internal/provider/source_mysql_resource.go index f6ba91389..6ccf6b147 100755 --- a/internal/provider/source_mysql_resource.go +++ b/internal/provider/source_mysql_resource.go @@ -611,6 +611,9 @@ func (r *SourceMysqlResource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourceMysql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -656,6 +659,9 @@ func (r *SourceMysqlResource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourceMysql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -692,6 +698,9 @@ func (r *SourceMysqlResource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourceMysql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -709,6 +718,9 @@ func (r *SourceMysqlResource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourceMysql(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -754,6 +766,9 @@ func (r *SourceMysqlResource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourceMysql(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_netsuite_data_source.go b/internal/provider/source_netsuite_data_source.go index 7cb15ab62..d09b27043 100755 --- a/internal/provider/source_netsuite_data_source.go +++ b/internal/provider/source_netsuite_data_source.go @@ -158,6 +158,9 @@ func (r *SourceNetsuiteDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceNetsuite(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_netsuite_resource.go b/internal/provider/source_netsuite_resource.go index c01f34b9c..b9c6700a6 100755 --- a/internal/provider/source_netsuite_resource.go +++ b/internal/provider/source_netsuite_resource.go @@ -172,6 +172,9 @@ func (r *SourceNetsuiteResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceNetsuite(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -217,6 +220,9 @@ func (r *SourceNetsuiteResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceNetsuite(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +259,9 @@ func (r *SourceNetsuiteResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceNetsuite(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -270,6 +279,9 @@ func (r *SourceNetsuiteResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceNetsuite(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -315,6 +327,9 @@ func (r *SourceNetsuiteResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceNetsuite(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_notion_data_source.go b/internal/provider/source_notion_data_source.go index 5db12ac5f..1feec1771 100755 --- a/internal/provider/source_notion_data_source.go +++ b/internal/provider/source_notion_data_source.go @@ -234,6 +234,9 @@ func (r *SourceNotionDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceNotion(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_notion_resource.go b/internal/provider/source_notion_resource.go index 4fa7958db..b131fb94f 100755 --- a/internal/provider/source_notion_resource.go +++ b/internal/provider/source_notion_resource.go @@ -248,6 +248,9 @@ func (r *SourceNotionResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceNotion(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -293,6 +296,9 @@ func (r *SourceNotionResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceNotion(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -329,6 +335,9 @@ func (r *SourceNotionResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceNotion(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -346,6 +355,9 @@ func (r *SourceNotionResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceNotion(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -391,6 +403,9 @@ func (r *SourceNotionResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceNotion(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_nytimes_data_source.go b/internal/provider/source_nytimes_data_source.go index cac3f859c..13e0abc42 100755 --- a/internal/provider/source_nytimes_data_source.go +++ b/internal/provider/source_nytimes_data_source.go @@ -169,6 +169,9 @@ func (r *SourceNytimesDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceNytimes(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_nytimes_resource.go b/internal/provider/source_nytimes_resource.go index 170ae579a..1c06d4563 100755 --- a/internal/provider/source_nytimes_resource.go +++ b/internal/provider/source_nytimes_resource.go @@ -183,6 +183,9 @@ func (r *SourceNytimesResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceNytimes(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +231,9 @@ func (r *SourceNytimesResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceNytimes(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -264,6 +270,9 @@ func (r *SourceNytimesResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceNytimes(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -281,6 +290,9 @@ func (r *SourceNytimesResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceNytimes(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -326,6 +338,9 @@ func (r *SourceNytimesResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceNytimes(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_okta_data_source.go b/internal/provider/source_okta_data_source.go index 6e5475331..bb47a0f41 100755 --- a/internal/provider/source_okta_data_source.go +++ b/internal/provider/source_okta_data_source.go @@ -230,6 +230,9 @@ func (r *SourceOktaDataSource) Read(ctx context.Context, req datasource.ReadRequ res, err := r.client.Sources.GetSourceOkta(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_okta_resource.go b/internal/provider/source_okta_resource.go index c4be13661..e991ebcc2 100755 --- a/internal/provider/source_okta_resource.go +++ b/internal/provider/source_okta_resource.go @@ -244,6 +244,9 @@ func (r *SourceOktaResource) Create(ctx context.Context, req resource.CreateRequ res, err := r.client.Sources.CreateSourceOkta(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -289,6 +292,9 @@ func (r *SourceOktaResource) Read(ctx context.Context, req resource.ReadRequest, res, err := r.client.Sources.GetSourceOkta(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -325,6 +331,9 @@ func (r *SourceOktaResource) Update(ctx context.Context, req resource.UpdateRequ res, err := r.client.Sources.PutSourceOkta(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -342,6 +351,9 @@ func (r *SourceOktaResource) Update(ctx context.Context, req resource.UpdateRequ getResponse, err := r.client.Sources.GetSourceOkta(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -387,6 +399,9 @@ func (r *SourceOktaResource) Delete(ctx context.Context, req resource.DeleteRequ res, err := r.client.Sources.DeleteSourceOkta(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_omnisend_data_source.go b/internal/provider/source_omnisend_data_source.go index eeba66d95..126ccad51 100755 --- a/internal/provider/source_omnisend_data_source.go +++ b/internal/provider/source_omnisend_data_source.go @@ -129,6 +129,9 @@ func (r *SourceOmnisendDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceOmnisend(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_omnisend_resource.go b/internal/provider/source_omnisend_resource.go index aaf8168d4..4ed57d4eb 100755 --- a/internal/provider/source_omnisend_resource.go +++ b/internal/provider/source_omnisend_resource.go @@ -143,6 +143,9 @@ func (r *SourceOmnisendResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceOmnisend(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceOmnisendResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceOmnisend(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceOmnisendResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceOmnisend(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceOmnisendResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceOmnisend(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceOmnisendResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceOmnisend(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_onesignal_data_source.go b/internal/provider/source_onesignal_data_source.go index a99207921..d8bdbdada 100755 --- a/internal/provider/source_onesignal_data_source.go +++ b/internal/provider/source_onesignal_data_source.go @@ -158,6 +158,9 @@ func (r *SourceOnesignalDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceOnesignal(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_onesignal_resource.go b/internal/provider/source_onesignal_resource.go index 1467af9fe..5e663408c 100755 --- a/internal/provider/source_onesignal_resource.go +++ b/internal/provider/source_onesignal_resource.go @@ -172,6 +172,9 @@ func (r *SourceOnesignalResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceOnesignal(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -217,6 +220,9 @@ func (r *SourceOnesignalResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceOnesignal(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +259,9 @@ func (r *SourceOnesignalResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceOnesignal(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -270,6 +279,9 @@ func (r *SourceOnesignalResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceOnesignal(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -315,6 +327,9 @@ func (r *SourceOnesignalResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceOnesignal(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_openweather_data_source.go b/internal/provider/source_openweather_data_source.go index e6517c140..ec2d036d4 100755 --- a/internal/provider/source_openweather_data_source.go +++ b/internal/provider/source_openweather_data_source.go @@ -207,6 +207,9 @@ func (r *SourceOpenweatherDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Sources.GetSourceOpenweather(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_openweather_resource.go b/internal/provider/source_openweather_resource.go index ad5eeed8a..7a9bdde22 100755 --- a/internal/provider/source_openweather_resource.go +++ b/internal/provider/source_openweather_resource.go @@ -221,6 +221,9 @@ func (r *SourceOpenweatherResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Sources.CreateSourceOpenweather(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -266,6 +269,9 @@ func (r *SourceOpenweatherResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Sources.GetSourceOpenweather(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -302,6 +308,9 @@ func (r *SourceOpenweatherResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Sources.PutSourceOpenweather(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -319,6 +328,9 @@ func (r *SourceOpenweatherResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Sources.GetSourceOpenweather(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -364,6 +376,9 @@ func (r *SourceOpenweatherResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Sources.DeleteSourceOpenweather(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_oracle_data_source.go b/internal/provider/source_oracle_data_source.go index e3003bcad..0201ea993 100755 --- a/internal/provider/source_oracle_data_source.go +++ b/internal/provider/source_oracle_data_source.go @@ -505,6 +505,9 @@ func (r *SourceOracleDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceOracle(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_oracle_resource.go b/internal/provider/source_oracle_resource.go index c98916efe..ff53d62fe 100755 --- a/internal/provider/source_oracle_resource.go +++ b/internal/provider/source_oracle_resource.go @@ -519,6 +519,9 @@ func (r *SourceOracleResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceOracle(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -564,6 +567,9 @@ func (r *SourceOracleResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceOracle(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -600,6 +606,9 @@ func (r *SourceOracleResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceOracle(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -617,6 +626,9 @@ func (r *SourceOracleResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceOracle(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -662,6 +674,9 @@ func (r *SourceOracleResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceOracle(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_orb_data_source.go b/internal/provider/source_orb_data_source.go index e86679d18..a379c0d18 100755 --- a/internal/provider/source_orb_data_source.go +++ b/internal/provider/source_orb_data_source.go @@ -155,6 +155,9 @@ func (r *SourceOrbDataSource) Read(ctx context.Context, req datasource.ReadReque res, err := r.client.Sources.GetSourceOrb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_orb_resource.go b/internal/provider/source_orb_resource.go index d734eeb4c..740c73514 100755 --- a/internal/provider/source_orb_resource.go +++ b/internal/provider/source_orb_resource.go @@ -169,6 +169,9 @@ func (r *SourceOrbResource) Create(ctx context.Context, req resource.CreateReque res, err := r.client.Sources.CreateSourceOrb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -214,6 +217,9 @@ func (r *SourceOrbResource) Read(ctx context.Context, req resource.ReadRequest, res, err := r.client.Sources.GetSourceOrb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -250,6 +256,9 @@ func (r *SourceOrbResource) Update(ctx context.Context, req resource.UpdateReque res, err := r.client.Sources.PutSourceOrb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -267,6 +276,9 @@ func (r *SourceOrbResource) Update(ctx context.Context, req resource.UpdateReque getResponse, err := r.client.Sources.GetSourceOrb(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -312,6 +324,9 @@ func (r *SourceOrbResource) Delete(ctx context.Context, req resource.DeleteReque res, err := r.client.Sources.DeleteSourceOrb(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_orbit_data_source.go b/internal/provider/source_orbit_data_source.go index 1201cc773..5999c1943 100755 --- a/internal/provider/source_orbit_data_source.go +++ b/internal/provider/source_orbit_data_source.go @@ -137,6 +137,9 @@ func (r *SourceOrbitDataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourceOrbit(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_orbit_resource.go b/internal/provider/source_orbit_resource.go index 358dc7da1..0e7c39dfc 100755 --- a/internal/provider/source_orbit_resource.go +++ b/internal/provider/source_orbit_resource.go @@ -151,6 +151,9 @@ func (r *SourceOrbitResource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourceOrbit(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceOrbitResource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourceOrbit(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceOrbitResource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourceOrbit(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceOrbitResource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourceOrbit(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceOrbitResource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourceOrbit(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_outreach_data_source.go b/internal/provider/source_outreach_data_source.go index 57fdf846f..b54e06692 100755 --- a/internal/provider/source_outreach_data_source.go +++ b/internal/provider/source_outreach_data_source.go @@ -145,6 +145,9 @@ func (r *SourceOutreachDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceOutreach(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_outreach_resource.go b/internal/provider/source_outreach_resource.go index a74f2a0ae..a4ae25c94 100755 --- a/internal/provider/source_outreach_resource.go +++ b/internal/provider/source_outreach_resource.go @@ -159,6 +159,9 @@ func (r *SourceOutreachResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceOutreach(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -204,6 +207,9 @@ func (r *SourceOutreachResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceOutreach(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +246,9 @@ func (r *SourceOutreachResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceOutreach(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -257,6 +266,9 @@ func (r *SourceOutreachResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceOutreach(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -302,6 +314,9 @@ func (r *SourceOutreachResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceOutreach(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_paypaltransaction_data_source.go b/internal/provider/source_paypaltransaction_data_source.go index 33756e6da..378acee90 100755 --- a/internal/provider/source_paypaltransaction_data_source.go +++ b/internal/provider/source_paypaltransaction_data_source.go @@ -149,6 +149,9 @@ func (r *SourcePaypalTransactionDataSource) Read(ctx context.Context, req dataso res, err := r.client.Sources.GetSourcePaypalTransaction(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_paypaltransaction_resource.go b/internal/provider/source_paypaltransaction_resource.go index 5fc71e277..f910aa1dd 100755 --- a/internal/provider/source_paypaltransaction_resource.go +++ b/internal/provider/source_paypaltransaction_resource.go @@ -163,6 +163,9 @@ func (r *SourcePaypalTransactionResource) Create(ctx context.Context, req resour res, err := r.client.Sources.CreateSourcePaypalTransaction(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -208,6 +211,9 @@ func (r *SourcePaypalTransactionResource) Read(ctx context.Context, req resource res, err := r.client.Sources.GetSourcePaypalTransaction(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +250,9 @@ func (r *SourcePaypalTransactionResource) Update(ctx context.Context, req resour res, err := r.client.Sources.PutSourcePaypalTransaction(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -261,6 +270,9 @@ func (r *SourcePaypalTransactionResource) Update(ctx context.Context, req resour getResponse, err := r.client.Sources.GetSourcePaypalTransaction(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -306,6 +318,9 @@ func (r *SourcePaypalTransactionResource) Delete(ctx context.Context, req resour res, err := r.client.Sources.DeleteSourcePaypalTransaction(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_paystack_data_source.go b/internal/provider/source_paystack_data_source.go index 32d7d7c21..ee2bb7fde 100755 --- a/internal/provider/source_paystack_data_source.go +++ b/internal/provider/source_paystack_data_source.go @@ -141,6 +141,9 @@ func (r *SourcePaystackDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourcePaystack(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_paystack_resource.go b/internal/provider/source_paystack_resource.go index 81a41d29e..3e0f1ba33 100755 --- a/internal/provider/source_paystack_resource.go +++ b/internal/provider/source_paystack_resource.go @@ -155,6 +155,9 @@ func (r *SourcePaystackResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourcePaystack(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -200,6 +203,9 @@ func (r *SourcePaystackResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourcePaystack(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -236,6 +242,9 @@ func (r *SourcePaystackResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourcePaystack(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +262,9 @@ func (r *SourcePaystackResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourcePaystack(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -298,6 +310,9 @@ func (r *SourcePaystackResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourcePaystack(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_pendo_data_source.go b/internal/provider/source_pendo_data_source.go index 710dc0ff7..147c18387 100755 --- a/internal/provider/source_pendo_data_source.go +++ b/internal/provider/source_pendo_data_source.go @@ -128,6 +128,9 @@ func (r *SourcePendoDataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourcePendo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_pendo_resource.go b/internal/provider/source_pendo_resource.go index 8650693f4..6c7412237 100755 --- a/internal/provider/source_pendo_resource.go +++ b/internal/provider/source_pendo_resource.go @@ -142,6 +142,9 @@ func (r *SourcePendoResource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourcePendo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -187,6 +190,9 @@ func (r *SourcePendoResource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourcePendo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -223,6 +229,9 @@ func (r *SourcePendoResource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourcePendo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +249,9 @@ func (r *SourcePendoResource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourcePendo(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -285,6 +297,9 @@ func (r *SourcePendoResource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourcePendo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_persistiq_data_source.go b/internal/provider/source_persistiq_data_source.go index 178739503..59dfd87b1 100755 --- a/internal/provider/source_persistiq_data_source.go +++ b/internal/provider/source_persistiq_data_source.go @@ -129,6 +129,9 @@ func (r *SourcePersistiqDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourcePersistiq(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_persistiq_resource.go b/internal/provider/source_persistiq_resource.go index cc5e56f43..b8fba2e9f 100755 --- a/internal/provider/source_persistiq_resource.go +++ b/internal/provider/source_persistiq_resource.go @@ -143,6 +143,9 @@ func (r *SourcePersistiqResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourcePersistiq(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourcePersistiqResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourcePersistiq(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourcePersistiqResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourcePersistiq(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourcePersistiqResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourcePersistiq(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourcePersistiqResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourcePersistiq(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_pexelsapi_data_source.go b/internal/provider/source_pexelsapi_data_source.go index 4b9d7544a..f1c88657f 100755 --- a/internal/provider/source_pexelsapi_data_source.go +++ b/internal/provider/source_pexelsapi_data_source.go @@ -149,6 +149,9 @@ func (r *SourcePexelsAPIDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourcePexelsAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_pexelsapi_resource.go b/internal/provider/source_pexelsapi_resource.go index 4ecf2d5d0..49f342697 100755 --- a/internal/provider/source_pexelsapi_resource.go +++ b/internal/provider/source_pexelsapi_resource.go @@ -163,6 +163,9 @@ func (r *SourcePexelsAPIResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourcePexelsAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -208,6 +211,9 @@ func (r *SourcePexelsAPIResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourcePexelsAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +250,9 @@ func (r *SourcePexelsAPIResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourcePexelsAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -261,6 +270,9 @@ func (r *SourcePexelsAPIResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourcePexelsAPI(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -306,6 +318,9 @@ func (r *SourcePexelsAPIResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourcePexelsAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_pinterest_data_source.go b/internal/provider/source_pinterest_data_source.go index 5a29a6cb2..b6fbbdf2e 100755 --- a/internal/provider/source_pinterest_data_source.go +++ b/internal/provider/source_pinterest_data_source.go @@ -234,6 +234,9 @@ func (r *SourcePinterestDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourcePinterest(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_pinterest_resource.go b/internal/provider/source_pinterest_resource.go index 1e08c1aaa..5e43ef76d 100755 --- a/internal/provider/source_pinterest_resource.go +++ b/internal/provider/source_pinterest_resource.go @@ -248,6 +248,9 @@ func (r *SourcePinterestResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourcePinterest(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -293,6 +296,9 @@ func (r *SourcePinterestResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourcePinterest(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -329,6 +335,9 @@ func (r *SourcePinterestResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourcePinterest(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -346,6 +355,9 @@ func (r *SourcePinterestResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourcePinterest(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -391,6 +403,9 @@ func (r *SourcePinterestResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourcePinterest(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_pipedrive_data_source.go b/internal/provider/source_pipedrive_data_source.go index af2ccef3d..c784099d2 100755 --- a/internal/provider/source_pipedrive_data_source.go +++ b/internal/provider/source_pipedrive_data_source.go @@ -151,6 +151,9 @@ func (r *SourcePipedriveDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourcePipedrive(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_pipedrive_resource.go b/internal/provider/source_pipedrive_resource.go index bb7dc4756..ba5518f36 100755 --- a/internal/provider/source_pipedrive_resource.go +++ b/internal/provider/source_pipedrive_resource.go @@ -165,6 +165,9 @@ func (r *SourcePipedriveResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourcePipedrive(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -210,6 +213,9 @@ func (r *SourcePipedriveResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourcePipedrive(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -246,6 +252,9 @@ func (r *SourcePipedriveResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourcePipedrive(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -263,6 +272,9 @@ func (r *SourcePipedriveResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourcePipedrive(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -308,6 +320,9 @@ func (r *SourcePipedriveResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourcePipedrive(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_pocket_data_source.go b/internal/provider/source_pocket_data_source.go index e6a4f83d1..36f5a9de8 100755 --- a/internal/provider/source_pocket_data_source.go +++ b/internal/provider/source_pocket_data_source.go @@ -201,6 +201,9 @@ func (r *SourcePocketDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourcePocket(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_pocket_resource.go b/internal/provider/source_pocket_resource.go index e9432e36a..1b3240fa1 100755 --- a/internal/provider/source_pocket_resource.go +++ b/internal/provider/source_pocket_resource.go @@ -215,6 +215,9 @@ func (r *SourcePocketResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourcePocket(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -260,6 +263,9 @@ func (r *SourcePocketResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourcePocket(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -296,6 +302,9 @@ func (r *SourcePocketResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourcePocket(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -313,6 +322,9 @@ func (r *SourcePocketResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourcePocket(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -358,6 +370,9 @@ func (r *SourcePocketResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourcePocket(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_pokeapi_data_source.go b/internal/provider/source_pokeapi_data_source.go index 17d6a941b..3ed209593 100755 --- a/internal/provider/source_pokeapi_data_source.go +++ b/internal/provider/source_pokeapi_data_source.go @@ -129,6 +129,9 @@ func (r *SourcePokeapiDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourcePokeapi(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_pokeapi_resource.go b/internal/provider/source_pokeapi_resource.go index 85b5bd684..25e44a32f 100755 --- a/internal/provider/source_pokeapi_resource.go +++ b/internal/provider/source_pokeapi_resource.go @@ -143,6 +143,9 @@ func (r *SourcePokeapiResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourcePokeapi(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourcePokeapiResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourcePokeapi(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourcePokeapiResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourcePokeapi(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourcePokeapiResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourcePokeapi(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourcePokeapiResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourcePokeapi(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_polygonstockapi_data_source.go b/internal/provider/source_polygonstockapi_data_source.go index 43295686c..70663cb3b 100755 --- a/internal/provider/source_polygonstockapi_data_source.go +++ b/internal/provider/source_polygonstockapi_data_source.go @@ -168,6 +168,9 @@ func (r *SourcePolygonStockAPIDataSource) Read(ctx context.Context, req datasour res, err := r.client.Sources.GetSourcePolygonStockAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_polygonstockapi_resource.go b/internal/provider/source_polygonstockapi_resource.go index a662807d4..3bf647946 100755 --- a/internal/provider/source_polygonstockapi_resource.go +++ b/internal/provider/source_polygonstockapi_resource.go @@ -182,6 +182,9 @@ func (r *SourcePolygonStockAPIResource) Create(ctx context.Context, req resource res, err := r.client.Sources.CreateSourcePolygonStockAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -227,6 +230,9 @@ func (r *SourcePolygonStockAPIResource) Read(ctx context.Context, req resource.R res, err := r.client.Sources.GetSourcePolygonStockAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -263,6 +269,9 @@ func (r *SourcePolygonStockAPIResource) Update(ctx context.Context, req resource res, err := r.client.Sources.PutSourcePolygonStockAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -280,6 +289,9 @@ func (r *SourcePolygonStockAPIResource) Update(ctx context.Context, req resource getResponse, err := r.client.Sources.GetSourcePolygonStockAPI(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -325,6 +337,9 @@ func (r *SourcePolygonStockAPIResource) Delete(ctx context.Context, req resource res, err := r.client.Sources.DeleteSourcePolygonStockAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_postgres_data_source.go b/internal/provider/source_postgres_data_source.go index 3f29f1bb9..f09c1b39a 100755 --- a/internal/provider/source_postgres_data_source.go +++ b/internal/provider/source_postgres_data_source.go @@ -819,6 +819,9 @@ func (r *SourcePostgresDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourcePostgres(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_postgres_resource.go b/internal/provider/source_postgres_resource.go index 6d745f68d..4024384a2 100755 --- a/internal/provider/source_postgres_resource.go +++ b/internal/provider/source_postgres_resource.go @@ -833,6 +833,9 @@ func (r *SourcePostgresResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourcePostgres(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -878,6 +881,9 @@ func (r *SourcePostgresResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourcePostgres(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -914,6 +920,9 @@ func (r *SourcePostgresResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourcePostgres(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -931,6 +940,9 @@ func (r *SourcePostgresResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourcePostgres(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -976,6 +988,9 @@ func (r *SourcePostgresResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourcePostgres(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_posthog_data_source.go b/internal/provider/source_posthog_data_source.go index e5ee04380..fd508c4bb 100755 --- a/internal/provider/source_posthog_data_source.go +++ b/internal/provider/source_posthog_data_source.go @@ -141,6 +141,9 @@ func (r *SourcePosthogDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourcePosthog(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_posthog_resource.go b/internal/provider/source_posthog_resource.go index 059f949c7..481b1cad4 100755 --- a/internal/provider/source_posthog_resource.go +++ b/internal/provider/source_posthog_resource.go @@ -155,6 +155,9 @@ func (r *SourcePosthogResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourcePosthog(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -200,6 +203,9 @@ func (r *SourcePosthogResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourcePosthog(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -236,6 +242,9 @@ func (r *SourcePosthogResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourcePosthog(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +262,9 @@ func (r *SourcePosthogResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourcePosthog(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -298,6 +310,9 @@ func (r *SourcePosthogResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourcePosthog(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_postmarkapp_data_source.go b/internal/provider/source_postmarkapp_data_source.go index 68b3662ef..da92392fe 100755 --- a/internal/provider/source_postmarkapp_data_source.go +++ b/internal/provider/source_postmarkapp_data_source.go @@ -133,6 +133,9 @@ func (r *SourcePostmarkappDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Sources.GetSourcePostmarkapp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_postmarkapp_resource.go b/internal/provider/source_postmarkapp_resource.go index 83c253164..5742c4654 100755 --- a/internal/provider/source_postmarkapp_resource.go +++ b/internal/provider/source_postmarkapp_resource.go @@ -147,6 +147,9 @@ func (r *SourcePostmarkappResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Sources.CreateSourcePostmarkapp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourcePostmarkappResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Sources.GetSourcePostmarkapp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourcePostmarkappResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Sources.PutSourcePostmarkapp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourcePostmarkappResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Sources.GetSourcePostmarkapp(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourcePostmarkappResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Sources.DeleteSourcePostmarkapp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_prestashop_data_source.go b/internal/provider/source_prestashop_data_source.go index 3f9a2bc89..452100f85 100755 --- a/internal/provider/source_prestashop_data_source.go +++ b/internal/provider/source_prestashop_data_source.go @@ -141,6 +141,9 @@ func (r *SourcePrestashopDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourcePrestashop(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_prestashop_resource.go b/internal/provider/source_prestashop_resource.go index 967421c84..4fc7f01db 100755 --- a/internal/provider/source_prestashop_resource.go +++ b/internal/provider/source_prestashop_resource.go @@ -155,6 +155,9 @@ func (r *SourcePrestashopResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourcePrestashop(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -200,6 +203,9 @@ func (r *SourcePrestashopResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourcePrestashop(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -236,6 +242,9 @@ func (r *SourcePrestashopResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourcePrestashop(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +262,9 @@ func (r *SourcePrestashopResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourcePrestashop(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -298,6 +310,9 @@ func (r *SourcePrestashopResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourcePrestashop(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_publicapis_data_source.go b/internal/provider/source_publicapis_data_source.go index b021809bd..cb83b30fb 100755 --- a/internal/provider/source_publicapis_data_source.go +++ b/internal/provider/source_publicapis_data_source.go @@ -125,6 +125,9 @@ func (r *SourcePublicApisDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourcePublicApis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_publicapis_resource.go b/internal/provider/source_publicapis_resource.go index 786882917..4314ad827 100755 --- a/internal/provider/source_publicapis_resource.go +++ b/internal/provider/source_publicapis_resource.go @@ -139,6 +139,9 @@ func (r *SourcePublicApisResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourcePublicApis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -184,6 +187,9 @@ func (r *SourcePublicApisResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourcePublicApis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -220,6 +226,9 @@ func (r *SourcePublicApisResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourcePublicApis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -237,6 +246,9 @@ func (r *SourcePublicApisResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourcePublicApis(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -282,6 +294,9 @@ func (r *SourcePublicApisResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourcePublicApis(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_punkapi_data_source.go b/internal/provider/source_punkapi_data_source.go index 04fdf47fa..cc68f0888 100755 --- a/internal/provider/source_punkapi_data_source.go +++ b/internal/provider/source_punkapi_data_source.go @@ -137,6 +137,9 @@ func (r *SourcePunkAPIDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourcePunkAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_punkapi_resource.go b/internal/provider/source_punkapi_resource.go index 78fd21ecf..b92581517 100755 --- a/internal/provider/source_punkapi_resource.go +++ b/internal/provider/source_punkapi_resource.go @@ -151,6 +151,9 @@ func (r *SourcePunkAPIResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourcePunkAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourcePunkAPIResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourcePunkAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourcePunkAPIResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourcePunkAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourcePunkAPIResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourcePunkAPI(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourcePunkAPIResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourcePunkAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_pypi_data_source.go b/internal/provider/source_pypi_data_source.go index fa703468d..6458a6011 100755 --- a/internal/provider/source_pypi_data_source.go +++ b/internal/provider/source_pypi_data_source.go @@ -133,6 +133,9 @@ func (r *SourcePypiDataSource) Read(ctx context.Context, req datasource.ReadRequ res, err := r.client.Sources.GetSourcePypi(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_pypi_resource.go b/internal/provider/source_pypi_resource.go index f2133ba4b..2b25382c7 100755 --- a/internal/provider/source_pypi_resource.go +++ b/internal/provider/source_pypi_resource.go @@ -147,6 +147,9 @@ func (r *SourcePypiResource) Create(ctx context.Context, req resource.CreateRequ res, err := r.client.Sources.CreateSourcePypi(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourcePypiResource) Read(ctx context.Context, req resource.ReadRequest, res, err := r.client.Sources.GetSourcePypi(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourcePypiResource) Update(ctx context.Context, req resource.UpdateRequ res, err := r.client.Sources.PutSourcePypi(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourcePypiResource) Update(ctx context.Context, req resource.UpdateRequ getResponse, err := r.client.Sources.GetSourcePypi(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourcePypiResource) Delete(ctx context.Context, req resource.DeleteRequ res, err := r.client.Sources.DeleteSourcePypi(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_qualaroo_data_source.go b/internal/provider/source_qualaroo_data_source.go index e0847519c..8eb9adaca 100755 --- a/internal/provider/source_qualaroo_data_source.go +++ b/internal/provider/source_qualaroo_data_source.go @@ -142,6 +142,9 @@ func (r *SourceQualarooDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceQualaroo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_qualaroo_resource.go b/internal/provider/source_qualaroo_resource.go index 54c8a17e1..921330f45 100755 --- a/internal/provider/source_qualaroo_resource.go +++ b/internal/provider/source_qualaroo_resource.go @@ -156,6 +156,9 @@ func (r *SourceQualarooResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceQualaroo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -201,6 +204,9 @@ func (r *SourceQualarooResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceQualaroo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -237,6 +243,9 @@ func (r *SourceQualarooResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceQualaroo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -254,6 +263,9 @@ func (r *SourceQualarooResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceQualaroo(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -299,6 +311,9 @@ func (r *SourceQualarooResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceQualaroo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_quickbooks_data_source.go b/internal/provider/source_quickbooks_data_source.go index b6ed9e2cd..16576960b 100755 --- a/internal/provider/source_quickbooks_data_source.go +++ b/internal/provider/source_quickbooks_data_source.go @@ -227,6 +227,9 @@ func (r *SourceQuickbooksDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceQuickbooks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_quickbooks_resource.go b/internal/provider/source_quickbooks_resource.go index dcb8ac67d..35a4582bf 100755 --- a/internal/provider/source_quickbooks_resource.go +++ b/internal/provider/source_quickbooks_resource.go @@ -241,6 +241,9 @@ func (r *SourceQuickbooksResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceQuickbooks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -286,6 +289,9 @@ func (r *SourceQuickbooksResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceQuickbooks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -322,6 +328,9 @@ func (r *SourceQuickbooksResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceQuickbooks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -339,6 +348,9 @@ func (r *SourceQuickbooksResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceQuickbooks(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -384,6 +396,9 @@ func (r *SourceQuickbooksResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceQuickbooks(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_railz_data_source.go b/internal/provider/source_railz_data_source.go index 8cf2cd2f9..e46847d36 100755 --- a/internal/provider/source_railz_data_source.go +++ b/internal/provider/source_railz_data_source.go @@ -137,6 +137,9 @@ func (r *SourceRailzDataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourceRailz(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_railz_resource.go b/internal/provider/source_railz_resource.go index 119e0f4bb..86f5e7389 100755 --- a/internal/provider/source_railz_resource.go +++ b/internal/provider/source_railz_resource.go @@ -151,6 +151,9 @@ func (r *SourceRailzResource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourceRailz(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceRailzResource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourceRailz(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceRailzResource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourceRailz(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceRailzResource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourceRailz(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceRailzResource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourceRailz(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_recharge_data_source.go b/internal/provider/source_recharge_data_source.go index e61cd3726..7899cbb40 100755 --- a/internal/provider/source_recharge_data_source.go +++ b/internal/provider/source_recharge_data_source.go @@ -137,6 +137,9 @@ func (r *SourceRechargeDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceRecharge(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_recharge_resource.go b/internal/provider/source_recharge_resource.go index 12b3e86d0..950b73ba7 100755 --- a/internal/provider/source_recharge_resource.go +++ b/internal/provider/source_recharge_resource.go @@ -151,6 +151,9 @@ func (r *SourceRechargeResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceRecharge(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceRechargeResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceRecharge(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceRechargeResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceRecharge(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceRechargeResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceRecharge(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceRechargeResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceRecharge(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_recreation_data_source.go b/internal/provider/source_recreation_data_source.go index e63f12a29..29b9b095c 100755 --- a/internal/provider/source_recreation_data_source.go +++ b/internal/provider/source_recreation_data_source.go @@ -132,6 +132,9 @@ func (r *SourceRecreationDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceRecreation(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_recreation_resource.go b/internal/provider/source_recreation_resource.go index 8f1edfc92..53c26774c 100755 --- a/internal/provider/source_recreation_resource.go +++ b/internal/provider/source_recreation_resource.go @@ -146,6 +146,9 @@ func (r *SourceRecreationResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceRecreation(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -191,6 +194,9 @@ func (r *SourceRecreationResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceRecreation(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -227,6 +233,9 @@ func (r *SourceRecreationResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceRecreation(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +253,9 @@ func (r *SourceRecreationResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceRecreation(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -289,6 +301,9 @@ func (r *SourceRecreationResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceRecreation(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_recruitee_data_source.go b/internal/provider/source_recruitee_data_source.go index 8b35aaa51..a4cff712d 100755 --- a/internal/provider/source_recruitee_data_source.go +++ b/internal/provider/source_recruitee_data_source.go @@ -133,6 +133,9 @@ func (r *SourceRecruiteeDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceRecruitee(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_recruitee_resource.go b/internal/provider/source_recruitee_resource.go index 88ade82c0..76aa54e55 100755 --- a/internal/provider/source_recruitee_resource.go +++ b/internal/provider/source_recruitee_resource.go @@ -147,6 +147,9 @@ func (r *SourceRecruiteeResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceRecruitee(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourceRecruiteeResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceRecruitee(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourceRecruiteeResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceRecruitee(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourceRecruiteeResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceRecruitee(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourceRecruiteeResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceRecruitee(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_recurly_data_source.go b/internal/provider/source_recurly_data_source.go index f7d89ad7e..6878dfcea 100755 --- a/internal/provider/source_recurly_data_source.go +++ b/internal/provider/source_recurly_data_source.go @@ -137,6 +137,9 @@ func (r *SourceRecurlyDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceRecurly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_recurly_resource.go b/internal/provider/source_recurly_resource.go index 17ec91f39..9ae077286 100755 --- a/internal/provider/source_recurly_resource.go +++ b/internal/provider/source_recurly_resource.go @@ -151,6 +151,9 @@ func (r *SourceRecurlyResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceRecurly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceRecurlyResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceRecurly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceRecurlyResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceRecurly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceRecurlyResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceRecurly(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceRecurlyResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceRecurly(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_redshift_data_source.go b/internal/provider/source_redshift_data_source.go index 1a26acaa0..a5f7c1a9c 100755 --- a/internal/provider/source_redshift_data_source.go +++ b/internal/provider/source_redshift_data_source.go @@ -154,6 +154,9 @@ func (r *SourceRedshiftDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceRedshift(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_redshift_resource.go b/internal/provider/source_redshift_resource.go index a1fa73c05..e5c4fa73e 100755 --- a/internal/provider/source_redshift_resource.go +++ b/internal/provider/source_redshift_resource.go @@ -168,6 +168,9 @@ func (r *SourceRedshiftResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceRedshift(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -213,6 +216,9 @@ func (r *SourceRedshiftResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceRedshift(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +255,9 @@ func (r *SourceRedshiftResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceRedshift(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -266,6 +275,9 @@ func (r *SourceRedshiftResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceRedshift(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -311,6 +323,9 @@ func (r *SourceRedshiftResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceRedshift(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_retently_data_source.go b/internal/provider/source_retently_data_source.go index 53e51c529..5fe191cc4 100755 --- a/internal/provider/source_retently_data_source.go +++ b/internal/provider/source_retently_data_source.go @@ -255,6 +255,9 @@ func (r *SourceRetentlyDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceRetently(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_retently_resource.go b/internal/provider/source_retently_resource.go index 41dac6dd7..4cddf241e 100755 --- a/internal/provider/source_retently_resource.go +++ b/internal/provider/source_retently_resource.go @@ -269,6 +269,9 @@ func (r *SourceRetentlyResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceRetently(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -314,6 +317,9 @@ func (r *SourceRetentlyResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceRetently(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -350,6 +356,9 @@ func (r *SourceRetentlyResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceRetently(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -367,6 +376,9 @@ func (r *SourceRetentlyResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceRetently(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -412,6 +424,9 @@ func (r *SourceRetentlyResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceRetently(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_rkicovid_data_source.go b/internal/provider/source_rkicovid_data_source.go index 50c4eca43..096d23fa0 100755 --- a/internal/provider/source_rkicovid_data_source.go +++ b/internal/provider/source_rkicovid_data_source.go @@ -129,6 +129,9 @@ func (r *SourceRkiCovidDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceRkiCovid(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_rkicovid_resource.go b/internal/provider/source_rkicovid_resource.go index 1e87e353d..410018fc5 100755 --- a/internal/provider/source_rkicovid_resource.go +++ b/internal/provider/source_rkicovid_resource.go @@ -143,6 +143,9 @@ func (r *SourceRkiCovidResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceRkiCovid(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceRkiCovidResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceRkiCovid(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceRkiCovidResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceRkiCovid(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceRkiCovidResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceRkiCovid(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceRkiCovidResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceRkiCovid(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_rss_data_source.go b/internal/provider/source_rss_data_source.go index 5af50b89b..fc22fe2a7 100755 --- a/internal/provider/source_rss_data_source.go +++ b/internal/provider/source_rss_data_source.go @@ -129,6 +129,9 @@ func (r *SourceRssDataSource) Read(ctx context.Context, req datasource.ReadReque res, err := r.client.Sources.GetSourceRss(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_rss_resource.go b/internal/provider/source_rss_resource.go index b2ba5397a..f492447dc 100755 --- a/internal/provider/source_rss_resource.go +++ b/internal/provider/source_rss_resource.go @@ -143,6 +143,9 @@ func (r *SourceRssResource) Create(ctx context.Context, req resource.CreateReque res, err := r.client.Sources.CreateSourceRss(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceRssResource) Read(ctx context.Context, req resource.ReadRequest, res, err := r.client.Sources.GetSourceRss(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceRssResource) Update(ctx context.Context, req resource.UpdateReque res, err := r.client.Sources.PutSourceRss(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceRssResource) Update(ctx context.Context, req resource.UpdateReque getResponse, err := r.client.Sources.GetSourceRss(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceRssResource) Delete(ctx context.Context, req resource.DeleteReque res, err := r.client.Sources.DeleteSourceRss(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_s3_data_source.go b/internal/provider/source_s3_data_source.go index ff80f0f8f..0dafceb56 100755 --- a/internal/provider/source_s3_data_source.go +++ b/internal/provider/source_s3_data_source.go @@ -446,6 +446,9 @@ func (r *SourceS3DataSource) Read(ctx context.Context, req datasource.ReadReques res, err := r.client.Sources.GetSourceS3(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_s3_resource.go b/internal/provider/source_s3_resource.go index 10d29d5ff..bbf444003 100755 --- a/internal/provider/source_s3_resource.go +++ b/internal/provider/source_s3_resource.go @@ -460,6 +460,9 @@ func (r *SourceS3Resource) Create(ctx context.Context, req resource.CreateReques res, err := r.client.Sources.CreateSourceS3(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -505,6 +508,9 @@ func (r *SourceS3Resource) Read(ctx context.Context, req resource.ReadRequest, r res, err := r.client.Sources.GetSourceS3(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -541,6 +547,9 @@ func (r *SourceS3Resource) Update(ctx context.Context, req resource.UpdateReques res, err := r.client.Sources.PutSourceS3(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -558,6 +567,9 @@ func (r *SourceS3Resource) Update(ctx context.Context, req resource.UpdateReques getResponse, err := r.client.Sources.GetSourceS3(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -603,6 +615,9 @@ func (r *SourceS3Resource) Delete(ctx context.Context, req resource.DeleteReques res, err := r.client.Sources.DeleteSourceS3(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_salesforce_data_source.go b/internal/provider/source_salesforce_data_source.go index 9407aa1dd..aa2766827 100755 --- a/internal/provider/source_salesforce_data_source.go +++ b/internal/provider/source_salesforce_data_source.go @@ -185,6 +185,9 @@ func (r *SourceSalesforceDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceSalesforce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_salesforce_resource.go b/internal/provider/source_salesforce_resource.go index 1506dab20..c692a5080 100755 --- a/internal/provider/source_salesforce_resource.go +++ b/internal/provider/source_salesforce_resource.go @@ -199,6 +199,9 @@ func (r *SourceSalesforceResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceSalesforce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +247,9 @@ func (r *SourceSalesforceResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceSalesforce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -280,6 +286,9 @@ func (r *SourceSalesforceResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceSalesforce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -297,6 +306,9 @@ func (r *SourceSalesforceResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceSalesforce(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -342,6 +354,9 @@ func (r *SourceSalesforceResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceSalesforce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_salesforcesinger_data_source.go b/internal/provider/source_salesforcesinger_data_source.go index 97fa5db03..071a0e373 100755 --- a/internal/provider/source_salesforcesinger_data_source.go +++ b/internal/provider/source_salesforcesinger_data_source.go @@ -164,6 +164,9 @@ func (r *SourceSalesforceSingerDataSource) Read(ctx context.Context, req datasou res, err := r.client.Sources.GetSourceSalesforceSinger(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_salesforcesinger_resource.go b/internal/provider/source_salesforcesinger_resource.go index 0a4b66dd6..74c1602ef 100755 --- a/internal/provider/source_salesforcesinger_resource.go +++ b/internal/provider/source_salesforcesinger_resource.go @@ -178,6 +178,9 @@ func (r *SourceSalesforceSingerResource) Create(ctx context.Context, req resourc res, err := r.client.Sources.CreateSourceSalesforceSinger(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -223,6 +226,9 @@ func (r *SourceSalesforceSingerResource) Read(ctx context.Context, req resource. res, err := r.client.Sources.GetSourceSalesforceSinger(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -259,6 +265,9 @@ func (r *SourceSalesforceSingerResource) Update(ctx context.Context, req resourc res, err := r.client.Sources.PutSourceSalesforceSinger(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -276,6 +285,9 @@ func (r *SourceSalesforceSingerResource) Update(ctx context.Context, req resourc getResponse, err := r.client.Sources.GetSourceSalesforceSinger(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -321,6 +333,9 @@ func (r *SourceSalesforceSingerResource) Delete(ctx context.Context, req resourc res, err := r.client.Sources.DeleteSourceSalesforceSinger(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_salesloft_data_source.go b/internal/provider/source_salesloft_data_source.go index 7b8addf3f..71753bf5f 100755 --- a/internal/provider/source_salesloft_data_source.go +++ b/internal/provider/source_salesloft_data_source.go @@ -251,6 +251,9 @@ func (r *SourceSalesloftDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceSalesloft(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_salesloft_resource.go b/internal/provider/source_salesloft_resource.go index ed814385d..82b22e145 100755 --- a/internal/provider/source_salesloft_resource.go +++ b/internal/provider/source_salesloft_resource.go @@ -265,6 +265,9 @@ func (r *SourceSalesloftResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceSalesloft(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -310,6 +313,9 @@ func (r *SourceSalesloftResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceSalesloft(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -346,6 +352,9 @@ func (r *SourceSalesloftResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceSalesloft(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -363,6 +372,9 @@ func (r *SourceSalesloftResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceSalesloft(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -408,6 +420,9 @@ func (r *SourceSalesloftResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceSalesloft(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_sapfieldglass_data_source.go b/internal/provider/source_sapfieldglass_data_source.go index 7d2d8b63f..b74531ee7 100755 --- a/internal/provider/source_sapfieldglass_data_source.go +++ b/internal/provider/source_sapfieldglass_data_source.go @@ -129,6 +129,9 @@ func (r *SourceSapFieldglassDataSource) Read(ctx context.Context, req datasource res, err := r.client.Sources.GetSourceSapFieldglass(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_sapfieldglass_resource.go b/internal/provider/source_sapfieldglass_resource.go index 31089141b..c78ca74b2 100755 --- a/internal/provider/source_sapfieldglass_resource.go +++ b/internal/provider/source_sapfieldglass_resource.go @@ -143,6 +143,9 @@ func (r *SourceSapFieldglassResource) Create(ctx context.Context, req resource.C res, err := r.client.Sources.CreateSourceSapFieldglass(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceSapFieldglassResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Sources.GetSourceSapFieldglass(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceSapFieldglassResource) Update(ctx context.Context, req resource.U res, err := r.client.Sources.PutSourceSapFieldglass(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceSapFieldglassResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Sources.GetSourceSapFieldglass(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceSapFieldglassResource) Delete(ctx context.Context, req resource.D res, err := r.client.Sources.DeleteSourceSapFieldglass(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_secoda_data_source.go b/internal/provider/source_secoda_data_source.go index b2f0c36ec..4f333f03c 100755 --- a/internal/provider/source_secoda_data_source.go +++ b/internal/provider/source_secoda_data_source.go @@ -129,6 +129,9 @@ func (r *SourceSecodaDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceSecoda(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_secoda_resource.go b/internal/provider/source_secoda_resource.go index 242e3e80d..3f9d43c9d 100755 --- a/internal/provider/source_secoda_resource.go +++ b/internal/provider/source_secoda_resource.go @@ -143,6 +143,9 @@ func (r *SourceSecodaResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceSecoda(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceSecodaResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceSecoda(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceSecodaResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceSecoda(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceSecodaResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceSecoda(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceSecodaResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceSecoda(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_sendgrid_data_source.go b/internal/provider/source_sendgrid_data_source.go index a845b3df6..0bd9d284c 100755 --- a/internal/provider/source_sendgrid_data_source.go +++ b/internal/provider/source_sendgrid_data_source.go @@ -137,6 +137,9 @@ func (r *SourceSendgridDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceSendgrid(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_sendgrid_resource.go b/internal/provider/source_sendgrid_resource.go index 8d23a2c32..f7956783a 100755 --- a/internal/provider/source_sendgrid_resource.go +++ b/internal/provider/source_sendgrid_resource.go @@ -151,6 +151,9 @@ func (r *SourceSendgridResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceSendgrid(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceSendgridResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceSendgrid(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceSendgridResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceSendgrid(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceSendgridResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceSendgrid(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceSendgridResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceSendgrid(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_sendinblue_data_source.go b/internal/provider/source_sendinblue_data_source.go index d1d78dc81..9986058fc 100755 --- a/internal/provider/source_sendinblue_data_source.go +++ b/internal/provider/source_sendinblue_data_source.go @@ -129,6 +129,9 @@ func (r *SourceSendinblueDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceSendinblue(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_sendinblue_resource.go b/internal/provider/source_sendinblue_resource.go index b7539a87f..2cdb2ecbd 100755 --- a/internal/provider/source_sendinblue_resource.go +++ b/internal/provider/source_sendinblue_resource.go @@ -143,6 +143,9 @@ func (r *SourceSendinblueResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceSendinblue(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceSendinblueResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceSendinblue(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceSendinblueResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceSendinblue(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceSendinblueResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceSendinblue(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceSendinblueResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceSendinblue(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_senseforce_data_source.go b/internal/provider/source_senseforce_data_source.go index 5aab17d49..f0ba49f8c 100755 --- a/internal/provider/source_senseforce_data_source.go +++ b/internal/provider/source_senseforce_data_source.go @@ -149,6 +149,9 @@ func (r *SourceSenseforceDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceSenseforce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_senseforce_resource.go b/internal/provider/source_senseforce_resource.go index c5a5e0a01..07bba875d 100755 --- a/internal/provider/source_senseforce_resource.go +++ b/internal/provider/source_senseforce_resource.go @@ -163,6 +163,9 @@ func (r *SourceSenseforceResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceSenseforce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -208,6 +211,9 @@ func (r *SourceSenseforceResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceSenseforce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +250,9 @@ func (r *SourceSenseforceResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceSenseforce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -261,6 +270,9 @@ func (r *SourceSenseforceResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceSenseforce(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -306,6 +318,9 @@ func (r *SourceSenseforceResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceSenseforce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_sentry_data_source.go b/internal/provider/source_sentry_data_source.go index 5a3afef59..f64c2cdb5 100755 --- a/internal/provider/source_sentry_data_source.go +++ b/internal/provider/source_sentry_data_source.go @@ -151,6 +151,9 @@ func (r *SourceSentryDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceSentry(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_sentry_resource.go b/internal/provider/source_sentry_resource.go index f3546b4af..62d32843c 100755 --- a/internal/provider/source_sentry_resource.go +++ b/internal/provider/source_sentry_resource.go @@ -165,6 +165,9 @@ func (r *SourceSentryResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceSentry(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -210,6 +213,9 @@ func (r *SourceSentryResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceSentry(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -246,6 +252,9 @@ func (r *SourceSentryResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceSentry(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -263,6 +272,9 @@ func (r *SourceSentryResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceSentry(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -308,6 +320,9 @@ func (r *SourceSentryResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceSentry(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_sftp_data_source.go b/internal/provider/source_sftp_data_source.go index 83de3a0ce..946f72d15 100755 --- a/internal/provider/source_sftp_data_source.go +++ b/internal/provider/source_sftp_data_source.go @@ -239,6 +239,9 @@ func (r *SourceSftpDataSource) Read(ctx context.Context, req datasource.ReadRequ res, err := r.client.Sources.GetSourceSftp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_sftp_resource.go b/internal/provider/source_sftp_resource.go index 09d384626..078ea45b4 100755 --- a/internal/provider/source_sftp_resource.go +++ b/internal/provider/source_sftp_resource.go @@ -253,6 +253,9 @@ func (r *SourceSftpResource) Create(ctx context.Context, req resource.CreateRequ res, err := r.client.Sources.CreateSourceSftp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -298,6 +301,9 @@ func (r *SourceSftpResource) Read(ctx context.Context, req resource.ReadRequest, res, err := r.client.Sources.GetSourceSftp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -334,6 +340,9 @@ func (r *SourceSftpResource) Update(ctx context.Context, req resource.UpdateRequ res, err := r.client.Sources.PutSourceSftp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -351,6 +360,9 @@ func (r *SourceSftpResource) Update(ctx context.Context, req resource.UpdateRequ getResponse, err := r.client.Sources.GetSourceSftp(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -396,6 +408,9 @@ func (r *SourceSftpResource) Delete(ctx context.Context, req resource.DeleteRequ res, err := r.client.Sources.DeleteSourceSftp(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_sftpbulk_data_source.go b/internal/provider/source_sftpbulk_data_source.go index 8bb381312..0c1a9c7b7 100755 --- a/internal/provider/source_sftpbulk_data_source.go +++ b/internal/provider/source_sftpbulk_data_source.go @@ -184,6 +184,9 @@ func (r *SourceSftpBulkDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceSftpBulk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_sftpbulk_resource.go b/internal/provider/source_sftpbulk_resource.go index 6f8021336..a3fc897ec 100755 --- a/internal/provider/source_sftpbulk_resource.go +++ b/internal/provider/source_sftpbulk_resource.go @@ -198,6 +198,9 @@ func (r *SourceSftpBulkResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceSftpBulk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -243,6 +246,9 @@ func (r *SourceSftpBulkResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceSftpBulk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -279,6 +285,9 @@ func (r *SourceSftpBulkResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceSftpBulk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -296,6 +305,9 @@ func (r *SourceSftpBulkResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceSftpBulk(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -341,6 +353,9 @@ func (r *SourceSftpBulkResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceSftpBulk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_shopify_data_source.go b/internal/provider/source_shopify_data_source.go index 10fc29438..1c2a2c118 100755 --- a/internal/provider/source_shopify_data_source.go +++ b/internal/provider/source_shopify_data_source.go @@ -238,6 +238,9 @@ func (r *SourceShopifyDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceShopify(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_shopify_resource.go b/internal/provider/source_shopify_resource.go index 13c92de89..fd00aa806 100755 --- a/internal/provider/source_shopify_resource.go +++ b/internal/provider/source_shopify_resource.go @@ -252,6 +252,9 @@ func (r *SourceShopifyResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceShopify(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -297,6 +300,9 @@ func (r *SourceShopifyResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceShopify(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -333,6 +339,9 @@ func (r *SourceShopifyResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceShopify(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -350,6 +359,9 @@ func (r *SourceShopifyResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceShopify(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -395,6 +407,9 @@ func (r *SourceShopifyResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceShopify(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_shortio_data_source.go b/internal/provider/source_shortio_data_source.go index 956f2e4d3..51feea4bf 100755 --- a/internal/provider/source_shortio_data_source.go +++ b/internal/provider/source_shortio_data_source.go @@ -136,6 +136,9 @@ func (r *SourceShortioDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceShortio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_shortio_resource.go b/internal/provider/source_shortio_resource.go index 00ed3032d..5574aa53d 100755 --- a/internal/provider/source_shortio_resource.go +++ b/internal/provider/source_shortio_resource.go @@ -150,6 +150,9 @@ func (r *SourceShortioResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceShortio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -195,6 +198,9 @@ func (r *SourceShortioResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceShortio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -231,6 +237,9 @@ func (r *SourceShortioResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceShortio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -248,6 +257,9 @@ func (r *SourceShortioResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceShortio(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -293,6 +305,9 @@ func (r *SourceShortioResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceShortio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_slack_data_source.go b/internal/provider/source_slack_data_source.go index 26850164a..0bbf6aa12 100755 --- a/internal/provider/source_slack_data_source.go +++ b/internal/provider/source_slack_data_source.go @@ -247,6 +247,9 @@ func (r *SourceSlackDataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourceSlack(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_slack_resource.go b/internal/provider/source_slack_resource.go index 3a4147f92..81424e4f6 100755 --- a/internal/provider/source_slack_resource.go +++ b/internal/provider/source_slack_resource.go @@ -261,6 +261,9 @@ func (r *SourceSlackResource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourceSlack(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -306,6 +309,9 @@ func (r *SourceSlackResource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourceSlack(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -342,6 +348,9 @@ func (r *SourceSlackResource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourceSlack(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -359,6 +368,9 @@ func (r *SourceSlackResource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourceSlack(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -404,6 +416,9 @@ func (r *SourceSlackResource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourceSlack(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_smaily_data_source.go b/internal/provider/source_smaily_data_source.go index f87f518f9..9e707f7bb 100755 --- a/internal/provider/source_smaily_data_source.go +++ b/internal/provider/source_smaily_data_source.go @@ -137,6 +137,9 @@ func (r *SourceSmailyDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceSmaily(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_smaily_resource.go b/internal/provider/source_smaily_resource.go index c8bb10ca0..e663e613c 100755 --- a/internal/provider/source_smaily_resource.go +++ b/internal/provider/source_smaily_resource.go @@ -151,6 +151,9 @@ func (r *SourceSmailyResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceSmaily(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceSmailyResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceSmaily(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceSmailyResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceSmaily(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceSmailyResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceSmaily(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceSmailyResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceSmaily(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_smartengage_data_source.go b/internal/provider/source_smartengage_data_source.go index 0f4a8aefc..41828403f 100755 --- a/internal/provider/source_smartengage_data_source.go +++ b/internal/provider/source_smartengage_data_source.go @@ -129,6 +129,9 @@ func (r *SourceSmartengageDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Sources.GetSourceSmartengage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_smartengage_resource.go b/internal/provider/source_smartengage_resource.go index 0957c4f2d..3e7b6fabf 100755 --- a/internal/provider/source_smartengage_resource.go +++ b/internal/provider/source_smartengage_resource.go @@ -143,6 +143,9 @@ func (r *SourceSmartengageResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Sources.CreateSourceSmartengage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceSmartengageResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Sources.GetSourceSmartengage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceSmartengageResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Sources.PutSourceSmartengage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceSmartengageResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Sources.GetSourceSmartengage(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceSmartengageResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Sources.DeleteSourceSmartengage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_smartsheets_data_source.go b/internal/provider/source_smartsheets_data_source.go index 8a8f44c25..1a33d0b7e 100755 --- a/internal/provider/source_smartsheets_data_source.go +++ b/internal/provider/source_smartsheets_data_source.go @@ -255,6 +255,9 @@ func (r *SourceSmartsheetsDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Sources.GetSourceSmartsheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_smartsheets_resource.go b/internal/provider/source_smartsheets_resource.go index fc81bf8ba..5dc146d0e 100755 --- a/internal/provider/source_smartsheets_resource.go +++ b/internal/provider/source_smartsheets_resource.go @@ -269,6 +269,9 @@ func (r *SourceSmartsheetsResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Sources.CreateSourceSmartsheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -314,6 +317,9 @@ func (r *SourceSmartsheetsResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Sources.GetSourceSmartsheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -350,6 +356,9 @@ func (r *SourceSmartsheetsResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Sources.PutSourceSmartsheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -367,6 +376,9 @@ func (r *SourceSmartsheetsResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Sources.GetSourceSmartsheets(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -412,6 +424,9 @@ func (r *SourceSmartsheetsResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Sources.DeleteSourceSmartsheets(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_snapchatmarketing_data_source.go b/internal/provider/source_snapchatmarketing_data_source.go index e8260b0ff..ff6c5d09e 100755 --- a/internal/provider/source_snapchatmarketing_data_source.go +++ b/internal/provider/source_snapchatmarketing_data_source.go @@ -152,6 +152,9 @@ func (r *SourceSnapchatMarketingDataSource) Read(ctx context.Context, req dataso res, err := r.client.Sources.GetSourceSnapchatMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_snapchatmarketing_resource.go b/internal/provider/source_snapchatmarketing_resource.go index badd8403d..75a2ba58c 100755 --- a/internal/provider/source_snapchatmarketing_resource.go +++ b/internal/provider/source_snapchatmarketing_resource.go @@ -166,6 +166,9 @@ func (r *SourceSnapchatMarketingResource) Create(ctx context.Context, req resour res, err := r.client.Sources.CreateSourceSnapchatMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -211,6 +214,9 @@ func (r *SourceSnapchatMarketingResource) Read(ctx context.Context, req resource res, err := r.client.Sources.GetSourceSnapchatMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -247,6 +253,9 @@ func (r *SourceSnapchatMarketingResource) Update(ctx context.Context, req resour res, err := r.client.Sources.PutSourceSnapchatMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -264,6 +273,9 @@ func (r *SourceSnapchatMarketingResource) Update(ctx context.Context, req resour getResponse, err := r.client.Sources.GetSourceSnapchatMarketing(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -309,6 +321,9 @@ func (r *SourceSnapchatMarketingResource) Delete(ctx context.Context, req resour res, err := r.client.Sources.DeleteSourceSnapchatMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_snowflake_data_source.go b/internal/provider/source_snowflake_data_source.go index ac8993ae2..72ca9a2a2 100755 --- a/internal/provider/source_snowflake_data_source.go +++ b/internal/provider/source_snowflake_data_source.go @@ -262,6 +262,9 @@ func (r *SourceSnowflakeDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceSnowflake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_snowflake_resource.go b/internal/provider/source_snowflake_resource.go index d0be1e9b8..787a81fc0 100755 --- a/internal/provider/source_snowflake_resource.go +++ b/internal/provider/source_snowflake_resource.go @@ -276,6 +276,9 @@ func (r *SourceSnowflakeResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceSnowflake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -321,6 +324,9 @@ func (r *SourceSnowflakeResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceSnowflake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -357,6 +363,9 @@ func (r *SourceSnowflakeResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceSnowflake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -374,6 +383,9 @@ func (r *SourceSnowflakeResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceSnowflake(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -419,6 +431,9 @@ func (r *SourceSnowflakeResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceSnowflake(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_sonarcloud_data_source.go b/internal/provider/source_sonarcloud_data_source.go index 00fc1a3e6..ec8d2d8b8 100755 --- a/internal/provider/source_sonarcloud_data_source.go +++ b/internal/provider/source_sonarcloud_data_source.go @@ -157,6 +157,9 @@ func (r *SourceSonarCloudDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceSonarCloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_sonarcloud_resource.go b/internal/provider/source_sonarcloud_resource.go index b33648bf6..c808d4c54 100755 --- a/internal/provider/source_sonarcloud_resource.go +++ b/internal/provider/source_sonarcloud_resource.go @@ -171,6 +171,9 @@ func (r *SourceSonarCloudResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceSonarCloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -216,6 +219,9 @@ func (r *SourceSonarCloudResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceSonarCloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -252,6 +258,9 @@ func (r *SourceSonarCloudResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceSonarCloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -269,6 +278,9 @@ func (r *SourceSonarCloudResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceSonarCloud(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -314,6 +326,9 @@ func (r *SourceSonarCloudResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceSonarCloud(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_spacexapi_data_source.go b/internal/provider/source_spacexapi_data_source.go index 1c569d291..a4497811d 100755 --- a/internal/provider/source_spacexapi_data_source.go +++ b/internal/provider/source_spacexapi_data_source.go @@ -131,6 +131,9 @@ func (r *SourceSpacexAPIDataSource) Read(ctx context.Context, req datasource.Rea res, err := r.client.Sources.GetSourceSpacexAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_spacexapi_resource.go b/internal/provider/source_spacexapi_resource.go index e590d6cb9..3e36a650a 100755 --- a/internal/provider/source_spacexapi_resource.go +++ b/internal/provider/source_spacexapi_resource.go @@ -145,6 +145,9 @@ func (r *SourceSpacexAPIResource) Create(ctx context.Context, req resource.Creat res, err := r.client.Sources.CreateSourceSpacexAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -190,6 +193,9 @@ func (r *SourceSpacexAPIResource) Read(ctx context.Context, req resource.ReadReq res, err := r.client.Sources.GetSourceSpacexAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -226,6 +232,9 @@ func (r *SourceSpacexAPIResource) Update(ctx context.Context, req resource.Updat res, err := r.client.Sources.PutSourceSpacexAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -243,6 +252,9 @@ func (r *SourceSpacexAPIResource) Update(ctx context.Context, req resource.Updat getResponse, err := r.client.Sources.GetSourceSpacexAPI(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -288,6 +300,9 @@ func (r *SourceSpacexAPIResource) Delete(ctx context.Context, req resource.Delet res, err := r.client.Sources.DeleteSourceSpacexAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_square_data_source.go b/internal/provider/source_square_data_source.go index 5b3b20b89..7e0e63f4d 100755 --- a/internal/provider/source_square_data_source.go +++ b/internal/provider/source_square_data_source.go @@ -242,6 +242,9 @@ func (r *SourceSquareDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceSquare(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_square_resource.go b/internal/provider/source_square_resource.go index 5caf5d538..fe9bdb13e 100755 --- a/internal/provider/source_square_resource.go +++ b/internal/provider/source_square_resource.go @@ -256,6 +256,9 @@ func (r *SourceSquareResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceSquare(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -301,6 +304,9 @@ func (r *SourceSquareResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceSquare(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -337,6 +343,9 @@ func (r *SourceSquareResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceSquare(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -354,6 +363,9 @@ func (r *SourceSquareResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceSquare(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -399,6 +411,9 @@ func (r *SourceSquareResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceSquare(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_strava_data_source.go b/internal/provider/source_strava_data_source.go index c15c694b1..18a75ef1e 100755 --- a/internal/provider/source_strava_data_source.go +++ b/internal/provider/source_strava_data_source.go @@ -158,6 +158,9 @@ func (r *SourceStravaDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceStrava(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_strava_resource.go b/internal/provider/source_strava_resource.go index d9cea8885..b4d6b08f1 100755 --- a/internal/provider/source_strava_resource.go +++ b/internal/provider/source_strava_resource.go @@ -172,6 +172,9 @@ func (r *SourceStravaResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceStrava(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -217,6 +220,9 @@ func (r *SourceStravaResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceStrava(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +259,9 @@ func (r *SourceStravaResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceStrava(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -270,6 +279,9 @@ func (r *SourceStravaResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceStrava(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -315,6 +327,9 @@ func (r *SourceStravaResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceStrava(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_stripe_data_source.go b/internal/provider/source_stripe_data_source.go index 89c53a297..6e38b0248 100755 --- a/internal/provider/source_stripe_data_source.go +++ b/internal/provider/source_stripe_data_source.go @@ -149,6 +149,9 @@ func (r *SourceStripeDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceStripe(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_stripe_resource.go b/internal/provider/source_stripe_resource.go index 80690a5f0..0bf17efad 100755 --- a/internal/provider/source_stripe_resource.go +++ b/internal/provider/source_stripe_resource.go @@ -163,6 +163,9 @@ func (r *SourceStripeResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceStripe(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -208,6 +211,9 @@ func (r *SourceStripeResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceStripe(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +250,9 @@ func (r *SourceStripeResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceStripe(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -261,6 +270,9 @@ func (r *SourceStripeResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceStripe(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -306,6 +318,9 @@ func (r *SourceStripeResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceStripe(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_surveymonkey_data_source.go b/internal/provider/source_surveymonkey_data_source.go index f463e7e84..98614121d 100755 --- a/internal/provider/source_surveymonkey_data_source.go +++ b/internal/provider/source_surveymonkey_data_source.go @@ -177,6 +177,9 @@ func (r *SourceSurveymonkeyDataSource) Read(ctx context.Context, req datasource. res, err := r.client.Sources.GetSourceSurveymonkey(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_surveymonkey_resource.go b/internal/provider/source_surveymonkey_resource.go index ef189d7ae..16076833e 100755 --- a/internal/provider/source_surveymonkey_resource.go +++ b/internal/provider/source_surveymonkey_resource.go @@ -191,6 +191,9 @@ func (r *SourceSurveymonkeyResource) Create(ctx context.Context, req resource.Cr res, err := r.client.Sources.CreateSourceSurveymonkey(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -236,6 +239,9 @@ func (r *SourceSurveymonkeyResource) Read(ctx context.Context, req resource.Read res, err := r.client.Sources.GetSourceSurveymonkey(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -272,6 +278,9 @@ func (r *SourceSurveymonkeyResource) Update(ctx context.Context, req resource.Up res, err := r.client.Sources.PutSourceSurveymonkey(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -289,6 +298,9 @@ func (r *SourceSurveymonkeyResource) Update(ctx context.Context, req resource.Up getResponse, err := r.client.Sources.GetSourceSurveymonkey(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -334,6 +346,9 @@ func (r *SourceSurveymonkeyResource) Delete(ctx context.Context, req resource.De res, err := r.client.Sources.DeleteSourceSurveymonkey(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_surveysparrow_data_source.go b/internal/provider/source_surveysparrow_data_source.go index e1d8bc422..58da2205f 100755 --- a/internal/provider/source_surveysparrow_data_source.go +++ b/internal/provider/source_surveysparrow_data_source.go @@ -208,6 +208,9 @@ func (r *SourceSurveySparrowDataSource) Read(ctx context.Context, req datasource res, err := r.client.Sources.GetSourceSurveySparrow(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_surveysparrow_resource.go b/internal/provider/source_surveysparrow_resource.go index 5d39be729..8e875b041 100755 --- a/internal/provider/source_surveysparrow_resource.go +++ b/internal/provider/source_surveysparrow_resource.go @@ -222,6 +222,9 @@ func (r *SourceSurveySparrowResource) Create(ctx context.Context, req resource.C res, err := r.client.Sources.CreateSourceSurveySparrow(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -267,6 +270,9 @@ func (r *SourceSurveySparrowResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Sources.GetSourceSurveySparrow(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -303,6 +309,9 @@ func (r *SourceSurveySparrowResource) Update(ctx context.Context, req resource.U res, err := r.client.Sources.PutSourceSurveySparrow(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -320,6 +329,9 @@ func (r *SourceSurveySparrowResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Sources.GetSourceSurveySparrow(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -365,6 +377,9 @@ func (r *SourceSurveySparrowResource) Delete(ctx context.Context, req resource.D res, err := r.client.Sources.DeleteSourceSurveySparrow(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_tempo_data_source.go b/internal/provider/source_tempo_data_source.go index 7f35ee63f..17f2fe36b 100755 --- a/internal/provider/source_tempo_data_source.go +++ b/internal/provider/source_tempo_data_source.go @@ -129,6 +129,9 @@ func (r *SourceTempoDataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourceTempo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_tempo_resource.go b/internal/provider/source_tempo_resource.go index fcb87c3fd..63adbbca0 100755 --- a/internal/provider/source_tempo_resource.go +++ b/internal/provider/source_tempo_resource.go @@ -143,6 +143,9 @@ func (r *SourceTempoResource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourceTempo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceTempoResource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourceTempo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceTempoResource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourceTempo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceTempoResource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourceTempo(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceTempoResource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourceTempo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_theguardianapi_data_source.go b/internal/provider/source_theguardianapi_data_source.go index 1953c1b5a..bae9ecf3f 100755 --- a/internal/provider/source_theguardianapi_data_source.go +++ b/internal/provider/source_theguardianapi_data_source.go @@ -149,6 +149,9 @@ func (r *SourceTheGuardianAPIDataSource) Read(ctx context.Context, req datasourc res, err := r.client.Sources.GetSourceTheGuardianAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_theguardianapi_resource.go b/internal/provider/source_theguardianapi_resource.go index bb5c89c7d..cc554785f 100755 --- a/internal/provider/source_theguardianapi_resource.go +++ b/internal/provider/source_theguardianapi_resource.go @@ -163,6 +163,9 @@ func (r *SourceTheGuardianAPIResource) Create(ctx context.Context, req resource. res, err := r.client.Sources.CreateSourceTheGuardianAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -208,6 +211,9 @@ func (r *SourceTheGuardianAPIResource) Read(ctx context.Context, req resource.Re res, err := r.client.Sources.GetSourceTheGuardianAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -244,6 +250,9 @@ func (r *SourceTheGuardianAPIResource) Update(ctx context.Context, req resource. res, err := r.client.Sources.PutSourceTheGuardianAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -261,6 +270,9 @@ func (r *SourceTheGuardianAPIResource) Update(ctx context.Context, req resource. getResponse, err := r.client.Sources.GetSourceTheGuardianAPI(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -306,6 +318,9 @@ func (r *SourceTheGuardianAPIResource) Delete(ctx context.Context, req resource. res, err := r.client.Sources.DeleteSourceTheGuardianAPI(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_tiktokmarketing_data_source.go b/internal/provider/source_tiktokmarketing_data_source.go index 415c3b7c1..b1fee6dee 100755 --- a/internal/provider/source_tiktokmarketing_data_source.go +++ b/internal/provider/source_tiktokmarketing_data_source.go @@ -261,6 +261,9 @@ func (r *SourceTiktokMarketingDataSource) Read(ctx context.Context, req datasour res, err := r.client.Sources.GetSourceTiktokMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_tiktokmarketing_resource.go b/internal/provider/source_tiktokmarketing_resource.go index 09d884e5b..14c04f6a7 100755 --- a/internal/provider/source_tiktokmarketing_resource.go +++ b/internal/provider/source_tiktokmarketing_resource.go @@ -275,6 +275,9 @@ func (r *SourceTiktokMarketingResource) Create(ctx context.Context, req resource res, err := r.client.Sources.CreateSourceTiktokMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -320,6 +323,9 @@ func (r *SourceTiktokMarketingResource) Read(ctx context.Context, req resource.R res, err := r.client.Sources.GetSourceTiktokMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -356,6 +362,9 @@ func (r *SourceTiktokMarketingResource) Update(ctx context.Context, req resource res, err := r.client.Sources.PutSourceTiktokMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -373,6 +382,9 @@ func (r *SourceTiktokMarketingResource) Update(ctx context.Context, req resource getResponse, err := r.client.Sources.GetSourceTiktokMarketing(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -418,6 +430,9 @@ func (r *SourceTiktokMarketingResource) Delete(ctx context.Context, req resource res, err := r.client.Sources.DeleteSourceTiktokMarketing(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_todoist_data_source.go b/internal/provider/source_todoist_data_source.go index d5d301ba7..87b1c5085 100755 --- a/internal/provider/source_todoist_data_source.go +++ b/internal/provider/source_todoist_data_source.go @@ -129,6 +129,9 @@ func (r *SourceTodoistDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceTodoist(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_todoist_resource.go b/internal/provider/source_todoist_resource.go index 1de7af7ae..8427498b0 100755 --- a/internal/provider/source_todoist_resource.go +++ b/internal/provider/source_todoist_resource.go @@ -143,6 +143,9 @@ func (r *SourceTodoistResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceTodoist(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceTodoistResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceTodoist(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceTodoistResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceTodoist(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceTodoistResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceTodoist(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceTodoistResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceTodoist(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_trello_data_source.go b/internal/provider/source_trello_data_source.go index b5bc5fd81..ec6ff3a91 100755 --- a/internal/provider/source_trello_data_source.go +++ b/internal/provider/source_trello_data_source.go @@ -146,6 +146,9 @@ func (r *SourceTrelloDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceTrello(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_trello_resource.go b/internal/provider/source_trello_resource.go index d7160205b..7c4542fea 100755 --- a/internal/provider/source_trello_resource.go +++ b/internal/provider/source_trello_resource.go @@ -160,6 +160,9 @@ func (r *SourceTrelloResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceTrello(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -205,6 +208,9 @@ func (r *SourceTrelloResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceTrello(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +247,9 @@ func (r *SourceTrelloResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceTrello(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -258,6 +267,9 @@ func (r *SourceTrelloResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceTrello(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -303,6 +315,9 @@ func (r *SourceTrelloResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceTrello(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_trustpilot_data_source.go b/internal/provider/source_trustpilot_data_source.go index e54c4f83d..310f82dd3 100755 --- a/internal/provider/source_trustpilot_data_source.go +++ b/internal/provider/source_trustpilot_data_source.go @@ -255,6 +255,9 @@ func (r *SourceTrustpilotDataSource) Read(ctx context.Context, req datasource.Re res, err := r.client.Sources.GetSourceTrustpilot(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_trustpilot_resource.go b/internal/provider/source_trustpilot_resource.go index 4ac350e51..9747c8079 100755 --- a/internal/provider/source_trustpilot_resource.go +++ b/internal/provider/source_trustpilot_resource.go @@ -269,6 +269,9 @@ func (r *SourceTrustpilotResource) Create(ctx context.Context, req resource.Crea res, err := r.client.Sources.CreateSourceTrustpilot(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -314,6 +317,9 @@ func (r *SourceTrustpilotResource) Read(ctx context.Context, req resource.ReadRe res, err := r.client.Sources.GetSourceTrustpilot(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -350,6 +356,9 @@ func (r *SourceTrustpilotResource) Update(ctx context.Context, req resource.Upda res, err := r.client.Sources.PutSourceTrustpilot(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -367,6 +376,9 @@ func (r *SourceTrustpilotResource) Update(ctx context.Context, req resource.Upda getResponse, err := r.client.Sources.GetSourceTrustpilot(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -412,6 +424,9 @@ func (r *SourceTrustpilotResource) Delete(ctx context.Context, req resource.Dele res, err := r.client.Sources.DeleteSourceTrustpilot(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_tvmazeschedule_data_source.go b/internal/provider/source_tvmazeschedule_data_source.go index faa16a781..87fee0ee3 100755 --- a/internal/provider/source_tvmazeschedule_data_source.go +++ b/internal/provider/source_tvmazeschedule_data_source.go @@ -145,6 +145,9 @@ func (r *SourceTvmazeScheduleDataSource) Read(ctx context.Context, req datasourc res, err := r.client.Sources.GetSourceTvmazeSchedule(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_tvmazeschedule_resource.go b/internal/provider/source_tvmazeschedule_resource.go index 5445e4aeb..ba719459c 100755 --- a/internal/provider/source_tvmazeschedule_resource.go +++ b/internal/provider/source_tvmazeschedule_resource.go @@ -159,6 +159,9 @@ func (r *SourceTvmazeScheduleResource) Create(ctx context.Context, req resource. res, err := r.client.Sources.CreateSourceTvmazeSchedule(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -204,6 +207,9 @@ func (r *SourceTvmazeScheduleResource) Read(ctx context.Context, req resource.Re res, err := r.client.Sources.GetSourceTvmazeSchedule(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +246,9 @@ func (r *SourceTvmazeScheduleResource) Update(ctx context.Context, req resource. res, err := r.client.Sources.PutSourceTvmazeSchedule(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -257,6 +266,9 @@ func (r *SourceTvmazeScheduleResource) Update(ctx context.Context, req resource. getResponse, err := r.client.Sources.GetSourceTvmazeSchedule(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -302,6 +314,9 @@ func (r *SourceTvmazeScheduleResource) Delete(ctx context.Context, req resource. res, err := r.client.Sources.DeleteSourceTvmazeSchedule(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_twilio_data_source.go b/internal/provider/source_twilio_data_source.go index e1576fa7f..b24c12114 100755 --- a/internal/provider/source_twilio_data_source.go +++ b/internal/provider/source_twilio_data_source.go @@ -145,6 +145,9 @@ func (r *SourceTwilioDataSource) Read(ctx context.Context, req datasource.ReadRe res, err := r.client.Sources.GetSourceTwilio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_twilio_resource.go b/internal/provider/source_twilio_resource.go index 3bae1f775..494199332 100755 --- a/internal/provider/source_twilio_resource.go +++ b/internal/provider/source_twilio_resource.go @@ -159,6 +159,9 @@ func (r *SourceTwilioResource) Create(ctx context.Context, req resource.CreateRe res, err := r.client.Sources.CreateSourceTwilio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -204,6 +207,9 @@ func (r *SourceTwilioResource) Read(ctx context.Context, req resource.ReadReques res, err := r.client.Sources.GetSourceTwilio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +246,9 @@ func (r *SourceTwilioResource) Update(ctx context.Context, req resource.UpdateRe res, err := r.client.Sources.PutSourceTwilio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -257,6 +266,9 @@ func (r *SourceTwilioResource) Update(ctx context.Context, req resource.UpdateRe getResponse, err := r.client.Sources.GetSourceTwilio(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -302,6 +314,9 @@ func (r *SourceTwilioResource) Delete(ctx context.Context, req resource.DeleteRe res, err := r.client.Sources.DeleteSourceTwilio(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_twiliotaskrouter_data_source.go b/internal/provider/source_twiliotaskrouter_data_source.go index cf8ba620c..2e954ff24 100755 --- a/internal/provider/source_twiliotaskrouter_data_source.go +++ b/internal/provider/source_twiliotaskrouter_data_source.go @@ -133,6 +133,9 @@ func (r *SourceTwilioTaskrouterDataSource) Read(ctx context.Context, req datasou res, err := r.client.Sources.GetSourceTwilioTaskrouter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_twiliotaskrouter_resource.go b/internal/provider/source_twiliotaskrouter_resource.go index a5209a7cc..4f091ec61 100755 --- a/internal/provider/source_twiliotaskrouter_resource.go +++ b/internal/provider/source_twiliotaskrouter_resource.go @@ -147,6 +147,9 @@ func (r *SourceTwilioTaskrouterResource) Create(ctx context.Context, req resourc res, err := r.client.Sources.CreateSourceTwilioTaskrouter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourceTwilioTaskrouterResource) Read(ctx context.Context, req resource. res, err := r.client.Sources.GetSourceTwilioTaskrouter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourceTwilioTaskrouterResource) Update(ctx context.Context, req resourc res, err := r.client.Sources.PutSourceTwilioTaskrouter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourceTwilioTaskrouterResource) Update(ctx context.Context, req resourc getResponse, err := r.client.Sources.GetSourceTwilioTaskrouter(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourceTwilioTaskrouterResource) Delete(ctx context.Context, req resourc res, err := r.client.Sources.DeleteSourceTwilioTaskrouter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_twitter_data_source.go b/internal/provider/source_twitter_data_source.go index 64633382d..106843b33 100755 --- a/internal/provider/source_twitter_data_source.go +++ b/internal/provider/source_twitter_data_source.go @@ -148,6 +148,9 @@ func (r *SourceTwitterDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceTwitter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_twitter_resource.go b/internal/provider/source_twitter_resource.go index 23d3a7cf5..5da6ae286 100755 --- a/internal/provider/source_twitter_resource.go +++ b/internal/provider/source_twitter_resource.go @@ -162,6 +162,9 @@ func (r *SourceTwitterResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceTwitter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -207,6 +210,9 @@ func (r *SourceTwitterResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceTwitter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -243,6 +249,9 @@ func (r *SourceTwitterResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceTwitter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -260,6 +269,9 @@ func (r *SourceTwitterResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceTwitter(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -305,6 +317,9 @@ func (r *SourceTwitterResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceTwitter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_typeform_data_source.go b/internal/provider/source_typeform_data_source.go index f6bca7ecb..6fcac7e4e 100755 --- a/internal/provider/source_typeform_data_source.go +++ b/internal/provider/source_typeform_data_source.go @@ -142,6 +142,9 @@ func (r *SourceTypeformDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceTypeform(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_typeform_resource.go b/internal/provider/source_typeform_resource.go index 27835cac2..84e95d5b9 100755 --- a/internal/provider/source_typeform_resource.go +++ b/internal/provider/source_typeform_resource.go @@ -156,6 +156,9 @@ func (r *SourceTypeformResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceTypeform(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -201,6 +204,9 @@ func (r *SourceTypeformResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceTypeform(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -237,6 +243,9 @@ func (r *SourceTypeformResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceTypeform(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -254,6 +263,9 @@ func (r *SourceTypeformResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceTypeform(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -299,6 +311,9 @@ func (r *SourceTypeformResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceTypeform(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_uscensus_data_source.go b/internal/provider/source_uscensus_data_source.go index 46f1a087b..b5a6be4c9 100755 --- a/internal/provider/source_uscensus_data_source.go +++ b/internal/provider/source_uscensus_data_source.go @@ -137,6 +137,9 @@ func (r *SourceUsCensusDataSource) Read(ctx context.Context, req datasource.Read res, err := r.client.Sources.GetSourceUsCensus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_uscensus_resource.go b/internal/provider/source_uscensus_resource.go index ee5de067a..9dae43e08 100755 --- a/internal/provider/source_uscensus_resource.go +++ b/internal/provider/source_uscensus_resource.go @@ -151,6 +151,9 @@ func (r *SourceUsCensusResource) Create(ctx context.Context, req resource.Create res, err := r.client.Sources.CreateSourceUsCensus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -196,6 +199,9 @@ func (r *SourceUsCensusResource) Read(ctx context.Context, req resource.ReadRequ res, err := r.client.Sources.GetSourceUsCensus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -232,6 +238,9 @@ func (r *SourceUsCensusResource) Update(ctx context.Context, req resource.Update res, err := r.client.Sources.PutSourceUsCensus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -249,6 +258,9 @@ func (r *SourceUsCensusResource) Update(ctx context.Context, req resource.Update getResponse, err := r.client.Sources.GetSourceUsCensus(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -294,6 +306,9 @@ func (r *SourceUsCensusResource) Delete(ctx context.Context, req resource.Delete res, err := r.client.Sources.DeleteSourceUsCensus(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_vantage_data_source.go b/internal/provider/source_vantage_data_source.go index 0021ddbb7..b228002cc 100755 --- a/internal/provider/source_vantage_data_source.go +++ b/internal/provider/source_vantage_data_source.go @@ -129,6 +129,9 @@ func (r *SourceVantageDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceVantage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_vantage_resource.go b/internal/provider/source_vantage_resource.go index ed77cfb01..d58da4bae 100755 --- a/internal/provider/source_vantage_resource.go +++ b/internal/provider/source_vantage_resource.go @@ -143,6 +143,9 @@ func (r *SourceVantageResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceVantage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceVantageResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceVantage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceVantageResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceVantage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceVantageResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceVantage(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceVantageResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceVantage(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_webflow_data_source.go b/internal/provider/source_webflow_data_source.go index fd6475a8f..fa9674bbf 100755 --- a/internal/provider/source_webflow_data_source.go +++ b/internal/provider/source_webflow_data_source.go @@ -133,6 +133,9 @@ func (r *SourceWebflowDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceWebflow(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_webflow_resource.go b/internal/provider/source_webflow_resource.go index d8454c6eb..0d10277d6 100755 --- a/internal/provider/source_webflow_resource.go +++ b/internal/provider/source_webflow_resource.go @@ -147,6 +147,9 @@ func (r *SourceWebflowResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceWebflow(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -192,6 +195,9 @@ func (r *SourceWebflowResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceWebflow(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -228,6 +234,9 @@ func (r *SourceWebflowResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceWebflow(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +254,9 @@ func (r *SourceWebflowResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceWebflow(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -290,6 +302,9 @@ func (r *SourceWebflowResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceWebflow(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_whiskyhunter_data_source.go b/internal/provider/source_whiskyhunter_data_source.go index 25689883a..ad713ea15 100755 --- a/internal/provider/source_whiskyhunter_data_source.go +++ b/internal/provider/source_whiskyhunter_data_source.go @@ -125,6 +125,9 @@ func (r *SourceWhiskyHunterDataSource) Read(ctx context.Context, req datasource. res, err := r.client.Sources.GetSourceWhiskyHunter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_whiskyhunter_resource.go b/internal/provider/source_whiskyhunter_resource.go index 8f980833c..365bc497e 100755 --- a/internal/provider/source_whiskyhunter_resource.go +++ b/internal/provider/source_whiskyhunter_resource.go @@ -139,6 +139,9 @@ func (r *SourceWhiskyHunterResource) Create(ctx context.Context, req resource.Cr res, err := r.client.Sources.CreateSourceWhiskyHunter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -184,6 +187,9 @@ func (r *SourceWhiskyHunterResource) Read(ctx context.Context, req resource.Read res, err := r.client.Sources.GetSourceWhiskyHunter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -220,6 +226,9 @@ func (r *SourceWhiskyHunterResource) Update(ctx context.Context, req resource.Up res, err := r.client.Sources.PutSourceWhiskyHunter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -237,6 +246,9 @@ func (r *SourceWhiskyHunterResource) Update(ctx context.Context, req resource.Up getResponse, err := r.client.Sources.GetSourceWhiskyHunter(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -282,6 +294,9 @@ func (r *SourceWhiskyHunterResource) Delete(ctx context.Context, req resource.De res, err := r.client.Sources.DeleteSourceWhiskyHunter(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_wikipediapageviews_data_source.go b/internal/provider/source_wikipediapageviews_data_source.go index f92ca829f..131bbd28e 100755 --- a/internal/provider/source_wikipediapageviews_data_source.go +++ b/internal/provider/source_wikipediapageviews_data_source.go @@ -153,6 +153,9 @@ func (r *SourceWikipediaPageviewsDataSource) Read(ctx context.Context, req datas res, err := r.client.Sources.GetSourceWikipediaPageviews(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_wikipediapageviews_resource.go b/internal/provider/source_wikipediapageviews_resource.go index 775035ae1..d5b5d80be 100755 --- a/internal/provider/source_wikipediapageviews_resource.go +++ b/internal/provider/source_wikipediapageviews_resource.go @@ -167,6 +167,9 @@ func (r *SourceWikipediaPageviewsResource) Create(ctx context.Context, req resou res, err := r.client.Sources.CreateSourceWikipediaPageviews(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -212,6 +215,9 @@ func (r *SourceWikipediaPageviewsResource) Read(ctx context.Context, req resourc res, err := r.client.Sources.GetSourceWikipediaPageviews(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -248,6 +254,9 @@ func (r *SourceWikipediaPageviewsResource) Update(ctx context.Context, req resou res, err := r.client.Sources.PutSourceWikipediaPageviews(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -265,6 +274,9 @@ func (r *SourceWikipediaPageviewsResource) Update(ctx context.Context, req resou getResponse, err := r.client.Sources.GetSourceWikipediaPageviews(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -310,6 +322,9 @@ func (r *SourceWikipediaPageviewsResource) Delete(ctx context.Context, req resou res, err := r.client.Sources.DeleteSourceWikipediaPageviews(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_woocommerce_data_source.go b/internal/provider/source_woocommerce_data_source.go index 391fafe53..f5fa9aa58 100755 --- a/internal/provider/source_woocommerce_data_source.go +++ b/internal/provider/source_woocommerce_data_source.go @@ -145,6 +145,9 @@ func (r *SourceWoocommerceDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Sources.GetSourceWoocommerce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_woocommerce_resource.go b/internal/provider/source_woocommerce_resource.go index 602f5f2b6..b8ff3ed15 100755 --- a/internal/provider/source_woocommerce_resource.go +++ b/internal/provider/source_woocommerce_resource.go @@ -159,6 +159,9 @@ func (r *SourceWoocommerceResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Sources.CreateSourceWoocommerce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -204,6 +207,9 @@ func (r *SourceWoocommerceResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Sources.GetSourceWoocommerce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +246,9 @@ func (r *SourceWoocommerceResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Sources.PutSourceWoocommerce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -257,6 +266,9 @@ func (r *SourceWoocommerceResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Sources.GetSourceWoocommerce(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -302,6 +314,9 @@ func (r *SourceWoocommerceResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Sources.DeleteSourceWoocommerce(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_xero_data_source.go b/internal/provider/source_xero_data_source.go index 19f91b5e9..13a3a91ae 100755 --- a/internal/provider/source_xero_data_source.go +++ b/internal/provider/source_xero_data_source.go @@ -162,6 +162,9 @@ func (r *SourceXeroDataSource) Read(ctx context.Context, req datasource.ReadRequ res, err := r.client.Sources.GetSourceXero(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_xero_resource.go b/internal/provider/source_xero_resource.go index 3ca804236..097af023c 100755 --- a/internal/provider/source_xero_resource.go +++ b/internal/provider/source_xero_resource.go @@ -176,6 +176,9 @@ func (r *SourceXeroResource) Create(ctx context.Context, req resource.CreateRequ res, err := r.client.Sources.CreateSourceXero(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -221,6 +224,9 @@ func (r *SourceXeroResource) Read(ctx context.Context, req resource.ReadRequest, res, err := r.client.Sources.GetSourceXero(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -257,6 +263,9 @@ func (r *SourceXeroResource) Update(ctx context.Context, req resource.UpdateRequ res, err := r.client.Sources.PutSourceXero(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -274,6 +283,9 @@ func (r *SourceXeroResource) Update(ctx context.Context, req resource.UpdateRequ getResponse, err := r.client.Sources.GetSourceXero(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -319,6 +331,9 @@ func (r *SourceXeroResource) Delete(ctx context.Context, req resource.DeleteRequ res, err := r.client.Sources.DeleteSourceXero(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_xkcd_data_source.go b/internal/provider/source_xkcd_data_source.go index 53d28f689..c9a3167a4 100755 --- a/internal/provider/source_xkcd_data_source.go +++ b/internal/provider/source_xkcd_data_source.go @@ -125,6 +125,9 @@ func (r *SourceXkcdDataSource) Read(ctx context.Context, req datasource.ReadRequ res, err := r.client.Sources.GetSourceXkcd(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_xkcd_resource.go b/internal/provider/source_xkcd_resource.go index 0d7f60a57..d8e4af667 100755 --- a/internal/provider/source_xkcd_resource.go +++ b/internal/provider/source_xkcd_resource.go @@ -139,6 +139,9 @@ func (r *SourceXkcdResource) Create(ctx context.Context, req resource.CreateRequ res, err := r.client.Sources.CreateSourceXkcd(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -184,6 +187,9 @@ func (r *SourceXkcdResource) Read(ctx context.Context, req resource.ReadRequest, res, err := r.client.Sources.GetSourceXkcd(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -220,6 +226,9 @@ func (r *SourceXkcdResource) Update(ctx context.Context, req resource.UpdateRequ res, err := r.client.Sources.PutSourceXkcd(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -237,6 +246,9 @@ func (r *SourceXkcdResource) Update(ctx context.Context, req resource.UpdateRequ getResponse, err := r.client.Sources.GetSourceXkcd(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -282,6 +294,9 @@ func (r *SourceXkcdResource) Delete(ctx context.Context, req resource.DeleteRequ res, err := r.client.Sources.DeleteSourceXkcd(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_yandexmetrica_data_source.go b/internal/provider/source_yandexmetrica_data_source.go index f650b5a67..206f8e326 100755 --- a/internal/provider/source_yandexmetrica_data_source.go +++ b/internal/provider/source_yandexmetrica_data_source.go @@ -148,6 +148,9 @@ func (r *SourceYandexMetricaDataSource) Read(ctx context.Context, req datasource res, err := r.client.Sources.GetSourceYandexMetrica(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_yandexmetrica_resource.go b/internal/provider/source_yandexmetrica_resource.go index 190be0676..b63835789 100755 --- a/internal/provider/source_yandexmetrica_resource.go +++ b/internal/provider/source_yandexmetrica_resource.go @@ -162,6 +162,9 @@ func (r *SourceYandexMetricaResource) Create(ctx context.Context, req resource.C res, err := r.client.Sources.CreateSourceYandexMetrica(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -207,6 +210,9 @@ func (r *SourceYandexMetricaResource) Read(ctx context.Context, req resource.Rea res, err := r.client.Sources.GetSourceYandexMetrica(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -243,6 +249,9 @@ func (r *SourceYandexMetricaResource) Update(ctx context.Context, req resource.U res, err := r.client.Sources.PutSourceYandexMetrica(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -260,6 +269,9 @@ func (r *SourceYandexMetricaResource) Update(ctx context.Context, req resource.U getResponse, err := r.client.Sources.GetSourceYandexMetrica(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -305,6 +317,9 @@ func (r *SourceYandexMetricaResource) Delete(ctx context.Context, req resource.D res, err := r.client.Sources.DeleteSourceYandexMetrica(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_yotpo_data_source.go b/internal/provider/source_yotpo_data_source.go index 914f191ba..9eddb6c5b 100755 --- a/internal/provider/source_yotpo_data_source.go +++ b/internal/provider/source_yotpo_data_source.go @@ -145,6 +145,9 @@ func (r *SourceYotpoDataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourceYotpo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_yotpo_resource.go b/internal/provider/source_yotpo_resource.go index 72fed8169..421e30ee0 100755 --- a/internal/provider/source_yotpo_resource.go +++ b/internal/provider/source_yotpo_resource.go @@ -159,6 +159,9 @@ func (r *SourceYotpoResource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourceYotpo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -204,6 +207,9 @@ func (r *SourceYotpoResource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourceYotpo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -240,6 +246,9 @@ func (r *SourceYotpoResource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourceYotpo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -257,6 +266,9 @@ func (r *SourceYotpoResource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourceYotpo(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -302,6 +314,9 @@ func (r *SourceYotpoResource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourceYotpo(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_younium_data_source.go b/internal/provider/source_younium_data_source.go index 02782ba6a..10c82869b 100755 --- a/internal/provider/source_younium_data_source.go +++ b/internal/provider/source_younium_data_source.go @@ -141,6 +141,9 @@ func (r *SourceYouniumDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceYounium(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_younium_resource.go b/internal/provider/source_younium_resource.go index b9c4e4cd7..5e49db6ae 100755 --- a/internal/provider/source_younium_resource.go +++ b/internal/provider/source_younium_resource.go @@ -155,6 +155,9 @@ func (r *SourceYouniumResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceYounium(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -200,6 +203,9 @@ func (r *SourceYouniumResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceYounium(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -236,6 +242,9 @@ func (r *SourceYouniumResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceYounium(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +262,9 @@ func (r *SourceYouniumResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceYounium(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -298,6 +310,9 @@ func (r *SourceYouniumResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceYounium(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_youtubeanalytics_data_source.go b/internal/provider/source_youtubeanalytics_data_source.go index f64c52c10..16da34d65 100755 --- a/internal/provider/source_youtubeanalytics_data_source.go +++ b/internal/provider/source_youtubeanalytics_data_source.go @@ -150,6 +150,9 @@ func (r *SourceYoutubeAnalyticsDataSource) Read(ctx context.Context, req datasou res, err := r.client.Sources.GetSourceYoutubeAnalytics(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_youtubeanalytics_resource.go b/internal/provider/source_youtubeanalytics_resource.go index 4678c2e1c..ebde0a561 100755 --- a/internal/provider/source_youtubeanalytics_resource.go +++ b/internal/provider/source_youtubeanalytics_resource.go @@ -164,6 +164,9 @@ func (r *SourceYoutubeAnalyticsResource) Create(ctx context.Context, req resourc res, err := r.client.Sources.CreateSourceYoutubeAnalytics(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -209,6 +212,9 @@ func (r *SourceYoutubeAnalyticsResource) Read(ctx context.Context, req resource. res, err := r.client.Sources.GetSourceYoutubeAnalytics(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +251,9 @@ func (r *SourceYoutubeAnalyticsResource) Update(ctx context.Context, req resourc res, err := r.client.Sources.PutSourceYoutubeAnalytics(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -262,6 +271,9 @@ func (r *SourceYoutubeAnalyticsResource) Update(ctx context.Context, req resourc getResponse, err := r.client.Sources.GetSourceYoutubeAnalytics(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -307,6 +319,9 @@ func (r *SourceYoutubeAnalyticsResource) Delete(ctx context.Context, req resourc res, err := r.client.Sources.DeleteSourceYoutubeAnalytics(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zendeskchat_data_source.go b/internal/provider/source_zendeskchat_data_source.go index 1f16906d6..db95de466 100755 --- a/internal/provider/source_zendeskchat_data_source.go +++ b/internal/provider/source_zendeskchat_data_source.go @@ -241,6 +241,9 @@ func (r *SourceZendeskChatDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Sources.GetSourceZendeskChat(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zendeskchat_resource.go b/internal/provider/source_zendeskchat_resource.go index d910cec28..ed70885ba 100755 --- a/internal/provider/source_zendeskchat_resource.go +++ b/internal/provider/source_zendeskchat_resource.go @@ -255,6 +255,9 @@ func (r *SourceZendeskChatResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Sources.CreateSourceZendeskChat(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -300,6 +303,9 @@ func (r *SourceZendeskChatResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Sources.GetSourceZendeskChat(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -336,6 +342,9 @@ func (r *SourceZendeskChatResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Sources.PutSourceZendeskChat(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -353,6 +362,9 @@ func (r *SourceZendeskChatResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Sources.GetSourceZendeskChat(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -398,6 +410,9 @@ func (r *SourceZendeskChatResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Sources.DeleteSourceZendeskChat(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zendesksunshine_data_source.go b/internal/provider/source_zendesksunshine_data_source.go index e2f906d55..01bccfb63 100755 --- a/internal/provider/source_zendesksunshine_data_source.go +++ b/internal/provider/source_zendesksunshine_data_source.go @@ -238,6 +238,9 @@ func (r *SourceZendeskSunshineDataSource) Read(ctx context.Context, req datasour res, err := r.client.Sources.GetSourceZendeskSunshine(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zendesksunshine_resource.go b/internal/provider/source_zendesksunshine_resource.go index a387291dc..edf08c0e8 100755 --- a/internal/provider/source_zendesksunshine_resource.go +++ b/internal/provider/source_zendesksunshine_resource.go @@ -252,6 +252,9 @@ func (r *SourceZendeskSunshineResource) Create(ctx context.Context, req resource res, err := r.client.Sources.CreateSourceZendeskSunshine(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -297,6 +300,9 @@ func (r *SourceZendeskSunshineResource) Read(ctx context.Context, req resource.R res, err := r.client.Sources.GetSourceZendeskSunshine(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -333,6 +339,9 @@ func (r *SourceZendeskSunshineResource) Update(ctx context.Context, req resource res, err := r.client.Sources.PutSourceZendeskSunshine(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -350,6 +359,9 @@ func (r *SourceZendeskSunshineResource) Update(ctx context.Context, req resource getResponse, err := r.client.Sources.GetSourceZendeskSunshine(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -395,6 +407,9 @@ func (r *SourceZendeskSunshineResource) Delete(ctx context.Context, req resource res, err := r.client.Sources.DeleteSourceZendeskSunshine(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zendesksupport_data_source.go b/internal/provider/source_zendesksupport_data_source.go index 47a093a87..69776c184 100755 --- a/internal/provider/source_zendesksupport_data_source.go +++ b/internal/provider/source_zendesksupport_data_source.go @@ -262,6 +262,9 @@ func (r *SourceZendeskSupportDataSource) Read(ctx context.Context, req datasourc res, err := r.client.Sources.GetSourceZendeskSupport(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zendesksupport_resource.go b/internal/provider/source_zendesksupport_resource.go index e67e4ae32..7f3706918 100755 --- a/internal/provider/source_zendesksupport_resource.go +++ b/internal/provider/source_zendesksupport_resource.go @@ -276,6 +276,9 @@ func (r *SourceZendeskSupportResource) Create(ctx context.Context, req resource. res, err := r.client.Sources.CreateSourceZendeskSupport(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -321,6 +324,9 @@ func (r *SourceZendeskSupportResource) Read(ctx context.Context, req resource.Re res, err := r.client.Sources.GetSourceZendeskSupport(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -357,6 +363,9 @@ func (r *SourceZendeskSupportResource) Update(ctx context.Context, req resource. res, err := r.client.Sources.PutSourceZendeskSupport(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -374,6 +383,9 @@ func (r *SourceZendeskSupportResource) Update(ctx context.Context, req resource. getResponse, err := r.client.Sources.GetSourceZendeskSupport(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -419,6 +431,9 @@ func (r *SourceZendeskSupportResource) Delete(ctx context.Context, req resource. res, err := r.client.Sources.DeleteSourceZendeskSupport(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zendesktalk_data_source.go b/internal/provider/source_zendesktalk_data_source.go index ce8907413..c5d8de655 100755 --- a/internal/provider/source_zendesktalk_data_source.go +++ b/internal/provider/source_zendesktalk_data_source.go @@ -258,6 +258,9 @@ func (r *SourceZendeskTalkDataSource) Read(ctx context.Context, req datasource.R res, err := r.client.Sources.GetSourceZendeskTalk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zendesktalk_resource.go b/internal/provider/source_zendesktalk_resource.go index 518337cfa..99cd32add 100755 --- a/internal/provider/source_zendesktalk_resource.go +++ b/internal/provider/source_zendesktalk_resource.go @@ -272,6 +272,9 @@ func (r *SourceZendeskTalkResource) Create(ctx context.Context, req resource.Cre res, err := r.client.Sources.CreateSourceZendeskTalk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -317,6 +320,9 @@ func (r *SourceZendeskTalkResource) Read(ctx context.Context, req resource.ReadR res, err := r.client.Sources.GetSourceZendeskTalk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -353,6 +359,9 @@ func (r *SourceZendeskTalkResource) Update(ctx context.Context, req resource.Upd res, err := r.client.Sources.PutSourceZendeskTalk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -370,6 +379,9 @@ func (r *SourceZendeskTalkResource) Update(ctx context.Context, req resource.Upd getResponse, err := r.client.Sources.GetSourceZendeskTalk(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -415,6 +427,9 @@ func (r *SourceZendeskTalkResource) Delete(ctx context.Context, req resource.Del res, err := r.client.Sources.DeleteSourceZendeskTalk(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zenloop_data_source.go b/internal/provider/source_zenloop_data_source.go index 6835e9a54..fc6a92b9d 100755 --- a/internal/provider/source_zenloop_data_source.go +++ b/internal/provider/source_zenloop_data_source.go @@ -141,6 +141,9 @@ func (r *SourceZenloopDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceZenloop(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zenloop_resource.go b/internal/provider/source_zenloop_resource.go index 6f0b85819..de69183ed 100755 --- a/internal/provider/source_zenloop_resource.go +++ b/internal/provider/source_zenloop_resource.go @@ -155,6 +155,9 @@ func (r *SourceZenloopResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceZenloop(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -200,6 +203,9 @@ func (r *SourceZenloopResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceZenloop(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -236,6 +242,9 @@ func (r *SourceZenloopResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceZenloop(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -253,6 +262,9 @@ func (r *SourceZenloopResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceZenloop(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -298,6 +310,9 @@ func (r *SourceZenloopResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceZenloop(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zohocrm_data_source.go b/internal/provider/source_zohocrm_data_source.go index 5e5d8a1d3..45e265b48 100755 --- a/internal/provider/source_zohocrm_data_source.go +++ b/internal/provider/source_zohocrm_data_source.go @@ -186,6 +186,9 @@ func (r *SourceZohoCrmDataSource) Read(ctx context.Context, req datasource.ReadR res, err := r.client.Sources.GetSourceZohoCrm(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zohocrm_resource.go b/internal/provider/source_zohocrm_resource.go index e9faf265c..ebf7bd536 100755 --- a/internal/provider/source_zohocrm_resource.go +++ b/internal/provider/source_zohocrm_resource.go @@ -200,6 +200,9 @@ func (r *SourceZohoCrmResource) Create(ctx context.Context, req resource.CreateR res, err := r.client.Sources.CreateSourceZohoCrm(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -245,6 +248,9 @@ func (r *SourceZohoCrmResource) Read(ctx context.Context, req resource.ReadReque res, err := r.client.Sources.GetSourceZohoCrm(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -281,6 +287,9 @@ func (r *SourceZohoCrmResource) Update(ctx context.Context, req resource.UpdateR res, err := r.client.Sources.PutSourceZohoCrm(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -298,6 +307,9 @@ func (r *SourceZohoCrmResource) Update(ctx context.Context, req resource.UpdateR getResponse, err := r.client.Sources.GetSourceZohoCrm(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -343,6 +355,9 @@ func (r *SourceZohoCrmResource) Delete(ctx context.Context, req resource.DeleteR res, err := r.client.Sources.DeleteSourceZohoCrm(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zoom_data_source.go b/internal/provider/source_zoom_data_source.go index e72e9fc63..8344b1ee4 100755 --- a/internal/provider/source_zoom_data_source.go +++ b/internal/provider/source_zoom_data_source.go @@ -129,6 +129,9 @@ func (r *SourceZoomDataSource) Read(ctx context.Context, req datasource.ReadRequ res, err := r.client.Sources.GetSourceZoom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zoom_resource.go b/internal/provider/source_zoom_resource.go index 45921ceae..56f783ddf 100755 --- a/internal/provider/source_zoom_resource.go +++ b/internal/provider/source_zoom_resource.go @@ -143,6 +143,9 @@ func (r *SourceZoomResource) Create(ctx context.Context, req resource.CreateRequ res, err := r.client.Sources.CreateSourceZoom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -188,6 +191,9 @@ func (r *SourceZoomResource) Read(ctx context.Context, req resource.ReadRequest, res, err := r.client.Sources.GetSourceZoom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -224,6 +230,9 @@ func (r *SourceZoomResource) Update(ctx context.Context, req resource.UpdateRequ res, err := r.client.Sources.PutSourceZoom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -241,6 +250,9 @@ func (r *SourceZoomResource) Update(ctx context.Context, req resource.UpdateRequ getResponse, err := r.client.Sources.GetSourceZoom(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -286,6 +298,9 @@ func (r *SourceZoomResource) Delete(ctx context.Context, req resource.DeleteRequ res, err := r.client.Sources.DeleteSourceZoom(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zuora_data_source.go b/internal/provider/source_zuora_data_source.go index 32a001691..b2d5cf6d7 100755 --- a/internal/provider/source_zuora_data_source.go +++ b/internal/provider/source_zuora_data_source.go @@ -170,6 +170,9 @@ func (r *SourceZuoraDataSource) Read(ctx context.Context, req datasource.ReadReq res, err := r.client.Sources.GetSourceZuora(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/source_zuora_resource.go b/internal/provider/source_zuora_resource.go index a19cf4272..871a6c004 100755 --- a/internal/provider/source_zuora_resource.go +++ b/internal/provider/source_zuora_resource.go @@ -184,6 +184,9 @@ func (r *SourceZuoraResource) Create(ctx context.Context, req resource.CreateReq res, err := r.client.Sources.CreateSourceZuora(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -229,6 +232,9 @@ func (r *SourceZuoraResource) Read(ctx context.Context, req resource.ReadRequest res, err := r.client.Sources.GetSourceZuora(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -265,6 +271,9 @@ func (r *SourceZuoraResource) Update(ctx context.Context, req resource.UpdateReq res, err := r.client.Sources.PutSourceZuora(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -282,6 +291,9 @@ func (r *SourceZuoraResource) Update(ctx context.Context, req resource.UpdateReq getResponse, err := r.client.Sources.GetSourceZuora(ctx, getRequest) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if getResponse == nil { @@ -327,6 +339,9 @@ func (r *SourceZuoraResource) Delete(ctx context.Context, req resource.DeleteReq res, err := r.client.Sources.DeleteSourceZuora(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/utils.go b/internal/provider/utils.go index e0b361774..22f9867c6 100755 --- a/internal/provider/utils.go +++ b/internal/provider/utils.go @@ -18,9 +18,12 @@ import ( ) func debugResponse(response *http.Response) string { - dumpReq, err := httputil.DumpRequest(response.Request, false) + dumpReq, err := httputil.DumpRequest(response.Request, true) if err != nil { - return err.Error() + dumpReq, err = httputil.DumpRequest(response.Request, false) + if err != nil { + return err.Error() + } } dumpRes, err := httputil.DumpResponse(response, true) if err != nil { diff --git a/internal/provider/workspace_data_source.go b/internal/provider/workspace_data_source.go index f8e1d4d88..c2917487e 100755 --- a/internal/provider/workspace_data_source.go +++ b/internal/provider/workspace_data_source.go @@ -114,6 +114,9 @@ func (r *WorkspaceDataSource) Read(ctx context.Context, req datasource.ReadReque res, err := r.client.Workspaces.GetWorkspace(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/provider/workspace_resource.go b/internal/provider/workspace_resource.go index f821b98ce..dac9e1b7b 100755 --- a/internal/provider/workspace_resource.go +++ b/internal/provider/workspace_resource.go @@ -121,6 +121,9 @@ func (r *WorkspaceResource) Create(ctx context.Context, req resource.CreateReque res, err := r.client.Workspaces.CreateWorkspace(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -166,6 +169,9 @@ func (r *WorkspaceResource) Read(ctx context.Context, req resource.ReadRequest, res, err := r.client.Workspaces.GetWorkspace(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -202,6 +208,9 @@ func (r *WorkspaceResource) Update(ctx context.Context, req resource.UpdateReque res, err := r.client.Workspaces.UpdateWorkspace(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { @@ -247,6 +256,9 @@ func (r *WorkspaceResource) Delete(ctx context.Context, req resource.DeleteReque res, err := r.client.Workspaces.DeleteWorkspace(ctx, request) if err != nil { resp.Diagnostics.AddError("failure to invoke API", err.Error()) + if res != nil && res.RawResponse != nil { + resp.Diagnostics.AddError("unexpected http request/response", debugResponse(res.RawResponse)) + } return } if res == nil { diff --git a/internal/sdk/connections.go b/internal/sdk/connections.go index cee1d5c60..6eaecfeb3 100755 --- a/internal/sdk/connections.go +++ b/internal/sdk/connections.go @@ -37,7 +37,10 @@ func (s *connections) CreateConnection(ctx context.Context, request shared.Conne return nil, fmt.Errorf("request body is required") } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -60,6 +63,7 @@ func (s *connections) CreateConnection(ctx context.Context, request shared.Conne if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -76,7 +80,7 @@ func (s *connections) CreateConnection(ctx context.Context, request shared.Conne case utils.MatchContentType(contentType, `application/json`): var out *shared.ConnectionResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.ConnectionResponse = out @@ -184,7 +188,7 @@ func (s *connections) GetConnection(ctx context.Context, request operations.GetC case utils.MatchContentType(contentType, `application/json`): var out *shared.ConnectionResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.ConnectionResponse = out @@ -243,7 +247,7 @@ func (s *connections) ListConnections(ctx context.Context, request operations.Li case utils.MatchContentType(contentType, `application/json`): var out *shared.ConnectionsResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.ConnectionsResponse = out @@ -272,7 +276,10 @@ func (s *connections) PatchConnection(ctx context.Context, request operations.Pa return nil, fmt.Errorf("request body is required") } - req, err := http.NewRequestWithContext(ctx, "PATCH", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PATCH", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -295,6 +302,7 @@ func (s *connections) PatchConnection(ctx context.Context, request operations.Pa if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -311,7 +319,7 @@ func (s *connections) PatchConnection(ctx context.Context, request operations.Pa case utils.MatchContentType(contentType, `application/json`): var out *shared.ConnectionResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.ConnectionResponse = out diff --git a/internal/sdk/destinations.go b/internal/sdk/destinations.go index 7bdb32523..1d5cec8d2 100755 --- a/internal/sdk/destinations.go +++ b/internal/sdk/destinations.go @@ -35,7 +35,10 @@ func (s *destinations) CreateDestination(ctx context.Context, request shared.Des return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -58,6 +61,7 @@ func (s *destinations) CreateDestination(ctx context.Context, request shared.Des if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -74,7 +78,7 @@ func (s *destinations) CreateDestination(ctx context.Context, request shared.Des case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -100,7 +104,10 @@ func (s *destinations) CreateDestinationAmazonSqs(ctx context.Context, request s return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -123,6 +130,7 @@ func (s *destinations) CreateDestinationAmazonSqs(ctx context.Context, request s if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -139,7 +147,7 @@ func (s *destinations) CreateDestinationAmazonSqs(ctx context.Context, request s case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -163,7 +171,10 @@ func (s *destinations) CreateDestinationAwsDatalake(ctx context.Context, request return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -186,6 +197,7 @@ func (s *destinations) CreateDestinationAwsDatalake(ctx context.Context, request if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -202,7 +214,7 @@ func (s *destinations) CreateDestinationAwsDatalake(ctx context.Context, request case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -226,7 +238,10 @@ func (s *destinations) CreateDestinationAzureBlobStorage(ctx context.Context, re return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -249,6 +264,7 @@ func (s *destinations) CreateDestinationAzureBlobStorage(ctx context.Context, re if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -265,7 +281,7 @@ func (s *destinations) CreateDestinationAzureBlobStorage(ctx context.Context, re case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -289,7 +305,10 @@ func (s *destinations) CreateDestinationBigquery(ctx context.Context, request sh return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -312,6 +331,7 @@ func (s *destinations) CreateDestinationBigquery(ctx context.Context, request sh if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -328,7 +348,7 @@ func (s *destinations) CreateDestinationBigquery(ctx context.Context, request sh case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -352,7 +372,10 @@ func (s *destinations) CreateDestinationBigqueryDenormalized(ctx context.Context return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -375,6 +398,7 @@ func (s *destinations) CreateDestinationBigqueryDenormalized(ctx context.Context if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -391,7 +415,7 @@ func (s *destinations) CreateDestinationBigqueryDenormalized(ctx context.Context case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -415,7 +439,10 @@ func (s *destinations) CreateDestinationCassandra(ctx context.Context, request s return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -438,6 +465,7 @@ func (s *destinations) CreateDestinationCassandra(ctx context.Context, request s if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -454,7 +482,7 @@ func (s *destinations) CreateDestinationCassandra(ctx context.Context, request s case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -478,7 +506,10 @@ func (s *destinations) CreateDestinationClickhouse(ctx context.Context, request return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -501,6 +532,7 @@ func (s *destinations) CreateDestinationClickhouse(ctx context.Context, request if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -517,7 +549,7 @@ func (s *destinations) CreateDestinationClickhouse(ctx context.Context, request case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -541,7 +573,10 @@ func (s *destinations) CreateDestinationConvex(ctx context.Context, request shar return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -564,6 +599,7 @@ func (s *destinations) CreateDestinationConvex(ctx context.Context, request shar if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -580,7 +616,7 @@ func (s *destinations) CreateDestinationConvex(ctx context.Context, request shar case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -604,7 +640,10 @@ func (s *destinations) CreateDestinationCumulio(ctx context.Context, request sha return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -627,6 +666,7 @@ func (s *destinations) CreateDestinationCumulio(ctx context.Context, request sha if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -643,7 +683,7 @@ func (s *destinations) CreateDestinationCumulio(ctx context.Context, request sha case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -667,7 +707,10 @@ func (s *destinations) CreateDestinationDatabend(ctx context.Context, request sh return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -690,6 +733,7 @@ func (s *destinations) CreateDestinationDatabend(ctx context.Context, request sh if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -706,7 +750,7 @@ func (s *destinations) CreateDestinationDatabend(ctx context.Context, request sh case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -730,7 +774,10 @@ func (s *destinations) CreateDestinationDatabricks(ctx context.Context, request return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -753,6 +800,7 @@ func (s *destinations) CreateDestinationDatabricks(ctx context.Context, request if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -769,7 +817,7 @@ func (s *destinations) CreateDestinationDatabricks(ctx context.Context, request case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -793,7 +841,10 @@ func (s *destinations) CreateDestinationDevNull(ctx context.Context, request sha return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -816,6 +867,7 @@ func (s *destinations) CreateDestinationDevNull(ctx context.Context, request sha if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -832,7 +884,7 @@ func (s *destinations) CreateDestinationDevNull(ctx context.Context, request sha case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -856,7 +908,10 @@ func (s *destinations) CreateDestinationDynamodb(ctx context.Context, request sh return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -879,6 +934,7 @@ func (s *destinations) CreateDestinationDynamodb(ctx context.Context, request sh if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -895,7 +951,7 @@ func (s *destinations) CreateDestinationDynamodb(ctx context.Context, request sh case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -919,7 +975,10 @@ func (s *destinations) CreateDestinationElasticsearch(ctx context.Context, reque return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -942,6 +1001,7 @@ func (s *destinations) CreateDestinationElasticsearch(ctx context.Context, reque if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -958,7 +1018,7 @@ func (s *destinations) CreateDestinationElasticsearch(ctx context.Context, reque case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -982,7 +1042,10 @@ func (s *destinations) CreateDestinationFirebolt(ctx context.Context, request sh return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1005,6 +1068,7 @@ func (s *destinations) CreateDestinationFirebolt(ctx context.Context, request sh if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1021,7 +1085,7 @@ func (s *destinations) CreateDestinationFirebolt(ctx context.Context, request sh case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1045,7 +1109,10 @@ func (s *destinations) CreateDestinationFirestore(ctx context.Context, request s return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1068,6 +1135,7 @@ func (s *destinations) CreateDestinationFirestore(ctx context.Context, request s if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1084,7 +1152,7 @@ func (s *destinations) CreateDestinationFirestore(ctx context.Context, request s case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1108,7 +1176,10 @@ func (s *destinations) CreateDestinationGcs(ctx context.Context, request shared. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1131,6 +1202,7 @@ func (s *destinations) CreateDestinationGcs(ctx context.Context, request shared. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1147,7 +1219,7 @@ func (s *destinations) CreateDestinationGcs(ctx context.Context, request shared. case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1171,7 +1243,10 @@ func (s *destinations) CreateDestinationGoogleSheets(ctx context.Context, reques return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1194,6 +1269,7 @@ func (s *destinations) CreateDestinationGoogleSheets(ctx context.Context, reques if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1210,7 +1286,7 @@ func (s *destinations) CreateDestinationGoogleSheets(ctx context.Context, reques case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1234,7 +1310,10 @@ func (s *destinations) CreateDestinationKeen(ctx context.Context, request shared return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1257,6 +1336,7 @@ func (s *destinations) CreateDestinationKeen(ctx context.Context, request shared if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1273,7 +1353,7 @@ func (s *destinations) CreateDestinationKeen(ctx context.Context, request shared case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1297,7 +1377,10 @@ func (s *destinations) CreateDestinationKinesis(ctx context.Context, request sha return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1320,6 +1403,7 @@ func (s *destinations) CreateDestinationKinesis(ctx context.Context, request sha if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1336,7 +1420,7 @@ func (s *destinations) CreateDestinationKinesis(ctx context.Context, request sha case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1360,7 +1444,10 @@ func (s *destinations) CreateDestinationMariadbColumnstore(ctx context.Context, return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1383,6 +1470,7 @@ func (s *destinations) CreateDestinationMariadbColumnstore(ctx context.Context, if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1399,7 +1487,7 @@ func (s *destinations) CreateDestinationMariadbColumnstore(ctx context.Context, case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1423,7 +1511,10 @@ func (s *destinations) CreateDestinationMeilisearch(ctx context.Context, request return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1446,6 +1537,7 @@ func (s *destinations) CreateDestinationMeilisearch(ctx context.Context, request if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1462,7 +1554,7 @@ func (s *destinations) CreateDestinationMeilisearch(ctx context.Context, request case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1486,7 +1578,10 @@ func (s *destinations) CreateDestinationMongodb(ctx context.Context, request sha return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1509,6 +1604,7 @@ func (s *destinations) CreateDestinationMongodb(ctx context.Context, request sha if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1525,7 +1621,7 @@ func (s *destinations) CreateDestinationMongodb(ctx context.Context, request sha case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1549,7 +1645,10 @@ func (s *destinations) CreateDestinationMssql(ctx context.Context, request share return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1572,6 +1671,7 @@ func (s *destinations) CreateDestinationMssql(ctx context.Context, request share if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1588,7 +1688,7 @@ func (s *destinations) CreateDestinationMssql(ctx context.Context, request share case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1612,7 +1712,10 @@ func (s *destinations) CreateDestinationMysql(ctx context.Context, request share return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1635,6 +1738,7 @@ func (s *destinations) CreateDestinationMysql(ctx context.Context, request share if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1651,7 +1755,7 @@ func (s *destinations) CreateDestinationMysql(ctx context.Context, request share case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1675,7 +1779,10 @@ func (s *destinations) CreateDestinationOracle(ctx context.Context, request shar return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1698,6 +1805,7 @@ func (s *destinations) CreateDestinationOracle(ctx context.Context, request shar if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1714,7 +1822,7 @@ func (s *destinations) CreateDestinationOracle(ctx context.Context, request shar case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1738,7 +1846,10 @@ func (s *destinations) CreateDestinationPostgres(ctx context.Context, request sh return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1761,6 +1872,7 @@ func (s *destinations) CreateDestinationPostgres(ctx context.Context, request sh if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1777,7 +1889,7 @@ func (s *destinations) CreateDestinationPostgres(ctx context.Context, request sh case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1801,7 +1913,10 @@ func (s *destinations) CreateDestinationPubsub(ctx context.Context, request shar return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1824,6 +1939,7 @@ func (s *destinations) CreateDestinationPubsub(ctx context.Context, request shar if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1840,7 +1956,7 @@ func (s *destinations) CreateDestinationPubsub(ctx context.Context, request shar case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1864,7 +1980,10 @@ func (s *destinations) CreateDestinationPulsar(ctx context.Context, request shar return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1887,6 +2006,7 @@ func (s *destinations) CreateDestinationPulsar(ctx context.Context, request shar if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1903,7 +2023,7 @@ func (s *destinations) CreateDestinationPulsar(ctx context.Context, request shar case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1927,7 +2047,10 @@ func (s *destinations) CreateDestinationRabbitmq(ctx context.Context, request sh return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1950,6 +2073,7 @@ func (s *destinations) CreateDestinationRabbitmq(ctx context.Context, request sh if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1966,7 +2090,7 @@ func (s *destinations) CreateDestinationRabbitmq(ctx context.Context, request sh case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -1990,7 +2114,10 @@ func (s *destinations) CreateDestinationRedis(ctx context.Context, request share return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2013,6 +2140,7 @@ func (s *destinations) CreateDestinationRedis(ctx context.Context, request share if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2029,7 +2157,7 @@ func (s *destinations) CreateDestinationRedis(ctx context.Context, request share case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -2053,7 +2181,10 @@ func (s *destinations) CreateDestinationRedshift(ctx context.Context, request sh return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2076,6 +2207,7 @@ func (s *destinations) CreateDestinationRedshift(ctx context.Context, request sh if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2092,7 +2224,7 @@ func (s *destinations) CreateDestinationRedshift(ctx context.Context, request sh case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -2116,7 +2248,10 @@ func (s *destinations) CreateDestinationRockset(ctx context.Context, request sha return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2139,6 +2274,7 @@ func (s *destinations) CreateDestinationRockset(ctx context.Context, request sha if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2155,7 +2291,7 @@ func (s *destinations) CreateDestinationRockset(ctx context.Context, request sha case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -2179,7 +2315,10 @@ func (s *destinations) CreateDestinationS3(ctx context.Context, request shared.D return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2202,6 +2341,7 @@ func (s *destinations) CreateDestinationS3(ctx context.Context, request shared.D if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2218,7 +2358,7 @@ func (s *destinations) CreateDestinationS3(ctx context.Context, request shared.D case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -2242,7 +2382,10 @@ func (s *destinations) CreateDestinationS3Glue(ctx context.Context, request shar return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2265,6 +2408,7 @@ func (s *destinations) CreateDestinationS3Glue(ctx context.Context, request shar if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2281,7 +2425,7 @@ func (s *destinations) CreateDestinationS3Glue(ctx context.Context, request shar case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -2305,7 +2449,10 @@ func (s *destinations) CreateDestinationScylla(ctx context.Context, request shar return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2328,6 +2475,7 @@ func (s *destinations) CreateDestinationScylla(ctx context.Context, request shar if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2344,7 +2492,7 @@ func (s *destinations) CreateDestinationScylla(ctx context.Context, request shar case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -2368,7 +2516,10 @@ func (s *destinations) CreateDestinationSftpJSON(ctx context.Context, request sh return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2391,6 +2542,7 @@ func (s *destinations) CreateDestinationSftpJSON(ctx context.Context, request sh if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2407,7 +2559,7 @@ func (s *destinations) CreateDestinationSftpJSON(ctx context.Context, request sh case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -2431,7 +2583,10 @@ func (s *destinations) CreateDestinationSnowflake(ctx context.Context, request s return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2454,6 +2609,7 @@ func (s *destinations) CreateDestinationSnowflake(ctx context.Context, request s if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2470,7 +2626,7 @@ func (s *destinations) CreateDestinationSnowflake(ctx context.Context, request s case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -2494,7 +2650,10 @@ func (s *destinations) CreateDestinationTypesense(ctx context.Context, request s return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2517,6 +2676,7 @@ func (s *destinations) CreateDestinationTypesense(ctx context.Context, request s if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2533,7 +2693,7 @@ func (s *destinations) CreateDestinationTypesense(ctx context.Context, request s case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -2557,7 +2717,10 @@ func (s *destinations) CreateDestinationVertica(ctx context.Context, request sha return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2580,6 +2743,7 @@ func (s *destinations) CreateDestinationVertica(ctx context.Context, request sha if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2596,7 +2760,7 @@ func (s *destinations) CreateDestinationVertica(ctx context.Context, request sha case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -4704,7 +4868,7 @@ func (s *destinations) GetDestination(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -4762,7 +4926,7 @@ func (s *destinations) GetDestinationAmazonSqs(ctx context.Context, request oper case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -4820,7 +4984,7 @@ func (s *destinations) GetDestinationAwsDatalake(ctx context.Context, request op case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -4878,7 +5042,7 @@ func (s *destinations) GetDestinationAzureBlobStorage(ctx context.Context, reque case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -4936,7 +5100,7 @@ func (s *destinations) GetDestinationBigquery(ctx context.Context, request opera case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -4994,7 +5158,7 @@ func (s *destinations) GetDestinationBigqueryDenormalized(ctx context.Context, r case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5052,7 +5216,7 @@ func (s *destinations) GetDestinationCassandra(ctx context.Context, request oper case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5110,7 +5274,7 @@ func (s *destinations) GetDestinationClickhouse(ctx context.Context, request ope case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5168,7 +5332,7 @@ func (s *destinations) GetDestinationConvex(ctx context.Context, request operati case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5226,7 +5390,7 @@ func (s *destinations) GetDestinationCumulio(ctx context.Context, request operat case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5284,7 +5448,7 @@ func (s *destinations) GetDestinationDatabend(ctx context.Context, request opera case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5342,7 +5506,7 @@ func (s *destinations) GetDestinationDatabricks(ctx context.Context, request ope case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5400,7 +5564,7 @@ func (s *destinations) GetDestinationDevNull(ctx context.Context, request operat case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5458,7 +5622,7 @@ func (s *destinations) GetDestinationDynamodb(ctx context.Context, request opera case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5516,7 +5680,7 @@ func (s *destinations) GetDestinationElasticsearch(ctx context.Context, request case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5574,7 +5738,7 @@ func (s *destinations) GetDestinationFirebolt(ctx context.Context, request opera case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5632,7 +5796,7 @@ func (s *destinations) GetDestinationFirestore(ctx context.Context, request oper case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5690,7 +5854,7 @@ func (s *destinations) GetDestinationGcs(ctx context.Context, request operations case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5748,7 +5912,7 @@ func (s *destinations) GetDestinationGoogleSheets(ctx context.Context, request o case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5806,7 +5970,7 @@ func (s *destinations) GetDestinationKeen(ctx context.Context, request operation case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5864,7 +6028,7 @@ func (s *destinations) GetDestinationKinesis(ctx context.Context, request operat case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5922,7 +6086,7 @@ func (s *destinations) GetDestinationMariadbColumnstore(ctx context.Context, req case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -5980,7 +6144,7 @@ func (s *destinations) GetDestinationMeilisearch(ctx context.Context, request op case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6038,7 +6202,7 @@ func (s *destinations) GetDestinationMongodb(ctx context.Context, request operat case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6096,7 +6260,7 @@ func (s *destinations) GetDestinationMssql(ctx context.Context, request operatio case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6154,7 +6318,7 @@ func (s *destinations) GetDestinationMysql(ctx context.Context, request operatio case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6212,7 +6376,7 @@ func (s *destinations) GetDestinationOracle(ctx context.Context, request operati case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6270,7 +6434,7 @@ func (s *destinations) GetDestinationPostgres(ctx context.Context, request opera case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6328,7 +6492,7 @@ func (s *destinations) GetDestinationPubsub(ctx context.Context, request operati case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6386,7 +6550,7 @@ func (s *destinations) GetDestinationPulsar(ctx context.Context, request operati case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6444,7 +6608,7 @@ func (s *destinations) GetDestinationRabbitmq(ctx context.Context, request opera case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6502,7 +6666,7 @@ func (s *destinations) GetDestinationRedis(ctx context.Context, request operatio case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6560,7 +6724,7 @@ func (s *destinations) GetDestinationRedshift(ctx context.Context, request opera case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6618,7 +6782,7 @@ func (s *destinations) GetDestinationRockset(ctx context.Context, request operat case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6676,7 +6840,7 @@ func (s *destinations) GetDestinationS3(ctx context.Context, request operations. case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6734,7 +6898,7 @@ func (s *destinations) GetDestinationS3Glue(ctx context.Context, request operati case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6792,7 +6956,7 @@ func (s *destinations) GetDestinationScylla(ctx context.Context, request operati case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6850,7 +7014,7 @@ func (s *destinations) GetDestinationSftpJSON(ctx context.Context, request opera case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6908,7 +7072,7 @@ func (s *destinations) GetDestinationSnowflake(ctx context.Context, request oper case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -6966,7 +7130,7 @@ func (s *destinations) GetDestinationTypesense(ctx context.Context, request oper case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -7024,7 +7188,7 @@ func (s *destinations) GetDestinationVertica(ctx context.Context, request operat case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -7083,7 +7247,7 @@ func (s *destinations) ListDestinations(ctx context.Context, request operations. case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationsResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationsResponse = out @@ -7109,7 +7273,10 @@ func (s *destinations) PatchDestination(ctx context.Context, request operations. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PATCH", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PATCH", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7132,6 +7299,7 @@ func (s *destinations) PatchDestination(ctx context.Context, request operations. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7148,7 +7316,7 @@ func (s *destinations) PatchDestination(ctx context.Context, request operations. case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -7174,7 +7342,10 @@ func (s *destinations) PutDestination(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7197,6 +7368,7 @@ func (s *destinations) PutDestination(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7213,7 +7385,7 @@ func (s *destinations) PutDestination(ctx context.Context, request operations.Pu case utils.MatchContentType(contentType, `application/json`): var out *shared.DestinationResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.DestinationResponse = out @@ -7239,7 +7411,10 @@ func (s *destinations) PutDestinationAmazonSqs(ctx context.Context, request oper return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7262,6 +7437,7 @@ func (s *destinations) PutDestinationAmazonSqs(ctx context.Context, request oper if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7296,7 +7472,10 @@ func (s *destinations) PutDestinationAwsDatalake(ctx context.Context, request op return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7319,6 +7498,7 @@ func (s *destinations) PutDestinationAwsDatalake(ctx context.Context, request op if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7353,7 +7533,10 @@ func (s *destinations) PutDestinationAzureBlobStorage(ctx context.Context, reque return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7376,6 +7559,7 @@ func (s *destinations) PutDestinationAzureBlobStorage(ctx context.Context, reque if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7410,7 +7594,10 @@ func (s *destinations) PutDestinationBigquery(ctx context.Context, request opera return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7433,6 +7620,7 @@ func (s *destinations) PutDestinationBigquery(ctx context.Context, request opera if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7467,7 +7655,10 @@ func (s *destinations) PutDestinationBigqueryDenormalized(ctx context.Context, r return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7490,6 +7681,7 @@ func (s *destinations) PutDestinationBigqueryDenormalized(ctx context.Context, r if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7524,7 +7716,10 @@ func (s *destinations) PutDestinationCassandra(ctx context.Context, request oper return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7547,6 +7742,7 @@ func (s *destinations) PutDestinationCassandra(ctx context.Context, request oper if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7581,7 +7777,10 @@ func (s *destinations) PutDestinationClickhouse(ctx context.Context, request ope return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7604,6 +7803,7 @@ func (s *destinations) PutDestinationClickhouse(ctx context.Context, request ope if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7638,7 +7838,10 @@ func (s *destinations) PutDestinationConvex(ctx context.Context, request operati return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7661,6 +7864,7 @@ func (s *destinations) PutDestinationConvex(ctx context.Context, request operati if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7695,7 +7899,10 @@ func (s *destinations) PutDestinationCumulio(ctx context.Context, request operat return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7718,6 +7925,7 @@ func (s *destinations) PutDestinationCumulio(ctx context.Context, request operat if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7752,7 +7960,10 @@ func (s *destinations) PutDestinationDatabend(ctx context.Context, request opera return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7775,6 +7986,7 @@ func (s *destinations) PutDestinationDatabend(ctx context.Context, request opera if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7809,7 +8021,10 @@ func (s *destinations) PutDestinationDatabricks(ctx context.Context, request ope return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7832,6 +8047,7 @@ func (s *destinations) PutDestinationDatabricks(ctx context.Context, request ope if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7866,7 +8082,10 @@ func (s *destinations) PutDestinationDevNull(ctx context.Context, request operat return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7889,6 +8108,7 @@ func (s *destinations) PutDestinationDevNull(ctx context.Context, request operat if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7923,7 +8143,10 @@ func (s *destinations) PutDestinationDynamodb(ctx context.Context, request opera return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7946,6 +8169,7 @@ func (s *destinations) PutDestinationDynamodb(ctx context.Context, request opera if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7980,7 +8204,10 @@ func (s *destinations) PutDestinationElasticsearch(ctx context.Context, request return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8003,6 +8230,7 @@ func (s *destinations) PutDestinationElasticsearch(ctx context.Context, request if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8037,7 +8265,10 @@ func (s *destinations) PutDestinationFirebolt(ctx context.Context, request opera return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8060,6 +8291,7 @@ func (s *destinations) PutDestinationFirebolt(ctx context.Context, request opera if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8094,7 +8326,10 @@ func (s *destinations) PutDestinationFirestore(ctx context.Context, request oper return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8117,6 +8352,7 @@ func (s *destinations) PutDestinationFirestore(ctx context.Context, request oper if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8151,7 +8387,10 @@ func (s *destinations) PutDestinationGcs(ctx context.Context, request operations return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8174,6 +8413,7 @@ func (s *destinations) PutDestinationGcs(ctx context.Context, request operations if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8208,7 +8448,10 @@ func (s *destinations) PutDestinationGoogleSheets(ctx context.Context, request o return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8231,6 +8474,7 @@ func (s *destinations) PutDestinationGoogleSheets(ctx context.Context, request o if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8265,7 +8509,10 @@ func (s *destinations) PutDestinationKeen(ctx context.Context, request operation return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8288,6 +8535,7 @@ func (s *destinations) PutDestinationKeen(ctx context.Context, request operation if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8322,7 +8570,10 @@ func (s *destinations) PutDestinationKinesis(ctx context.Context, request operat return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8345,6 +8596,7 @@ func (s *destinations) PutDestinationKinesis(ctx context.Context, request operat if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8379,7 +8631,10 @@ func (s *destinations) PutDestinationMariadbColumnstore(ctx context.Context, req return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8402,6 +8657,7 @@ func (s *destinations) PutDestinationMariadbColumnstore(ctx context.Context, req if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8436,7 +8692,10 @@ func (s *destinations) PutDestinationMeilisearch(ctx context.Context, request op return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8459,6 +8718,7 @@ func (s *destinations) PutDestinationMeilisearch(ctx context.Context, request op if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8493,7 +8753,10 @@ func (s *destinations) PutDestinationMongodb(ctx context.Context, request operat return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8516,6 +8779,7 @@ func (s *destinations) PutDestinationMongodb(ctx context.Context, request operat if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8550,7 +8814,10 @@ func (s *destinations) PutDestinationMssql(ctx context.Context, request operatio return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8573,6 +8840,7 @@ func (s *destinations) PutDestinationMssql(ctx context.Context, request operatio if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8607,7 +8875,10 @@ func (s *destinations) PutDestinationMysql(ctx context.Context, request operatio return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8630,6 +8901,7 @@ func (s *destinations) PutDestinationMysql(ctx context.Context, request operatio if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8664,7 +8936,10 @@ func (s *destinations) PutDestinationOracle(ctx context.Context, request operati return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8687,6 +8962,7 @@ func (s *destinations) PutDestinationOracle(ctx context.Context, request operati if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8721,7 +8997,10 @@ func (s *destinations) PutDestinationPostgres(ctx context.Context, request opera return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8744,6 +9023,7 @@ func (s *destinations) PutDestinationPostgres(ctx context.Context, request opera if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8778,7 +9058,10 @@ func (s *destinations) PutDestinationPubsub(ctx context.Context, request operati return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8801,6 +9084,7 @@ func (s *destinations) PutDestinationPubsub(ctx context.Context, request operati if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8835,7 +9119,10 @@ func (s *destinations) PutDestinationPulsar(ctx context.Context, request operati return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8858,6 +9145,7 @@ func (s *destinations) PutDestinationPulsar(ctx context.Context, request operati if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8892,7 +9180,10 @@ func (s *destinations) PutDestinationRabbitmq(ctx context.Context, request opera return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8915,6 +9206,7 @@ func (s *destinations) PutDestinationRabbitmq(ctx context.Context, request opera if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8949,7 +9241,10 @@ func (s *destinations) PutDestinationRedis(ctx context.Context, request operatio return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8972,6 +9267,7 @@ func (s *destinations) PutDestinationRedis(ctx context.Context, request operatio if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9006,7 +9302,10 @@ func (s *destinations) PutDestinationRedshift(ctx context.Context, request opera return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9029,6 +9328,7 @@ func (s *destinations) PutDestinationRedshift(ctx context.Context, request opera if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9063,7 +9363,10 @@ func (s *destinations) PutDestinationRockset(ctx context.Context, request operat return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9086,6 +9389,7 @@ func (s *destinations) PutDestinationRockset(ctx context.Context, request operat if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9120,7 +9424,10 @@ func (s *destinations) PutDestinationS3(ctx context.Context, request operations. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9143,6 +9450,7 @@ func (s *destinations) PutDestinationS3(ctx context.Context, request operations. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9177,7 +9485,10 @@ func (s *destinations) PutDestinationS3Glue(ctx context.Context, request operati return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9200,6 +9511,7 @@ func (s *destinations) PutDestinationS3Glue(ctx context.Context, request operati if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9234,7 +9546,10 @@ func (s *destinations) PutDestinationScylla(ctx context.Context, request operati return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9257,6 +9572,7 @@ func (s *destinations) PutDestinationScylla(ctx context.Context, request operati if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9291,7 +9607,10 @@ func (s *destinations) PutDestinationSftpJSON(ctx context.Context, request opera return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9314,6 +9633,7 @@ func (s *destinations) PutDestinationSftpJSON(ctx context.Context, request opera if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9348,7 +9668,10 @@ func (s *destinations) PutDestinationSnowflake(ctx context.Context, request oper return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9371,6 +9694,7 @@ func (s *destinations) PutDestinationSnowflake(ctx context.Context, request oper if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9405,7 +9729,10 @@ func (s *destinations) PutDestinationTypesense(ctx context.Context, request oper return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9428,6 +9755,7 @@ func (s *destinations) PutDestinationTypesense(ctx context.Context, request oper if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9462,7 +9790,10 @@ func (s *destinations) PutDestinationVertica(ctx context.Context, request operat return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9485,6 +9816,7 @@ func (s *destinations) PutDestinationVertica(ctx context.Context, request operat if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) diff --git a/internal/sdk/jobs.go b/internal/sdk/jobs.go index df705ab66..75cbfcfc3 100755 --- a/internal/sdk/jobs.go +++ b/internal/sdk/jobs.go @@ -69,7 +69,7 @@ func (s *jobs) CancelJob(ctx context.Context, request operations.CancelJobReques case utils.MatchContentType(contentType, `application/json`): var out *shared.JobResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.JobResponse = out @@ -95,7 +95,10 @@ func (s *jobs) CreateJob(ctx context.Context, request shared.JobCreateRequest) ( return nil, fmt.Errorf("request body is required") } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -118,6 +121,7 @@ func (s *jobs) CreateJob(ctx context.Context, request shared.JobCreateRequest) ( if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -134,7 +138,7 @@ func (s *jobs) CreateJob(ctx context.Context, request shared.JobCreateRequest) ( case utils.MatchContentType(contentType, `application/json`): var out *shared.JobResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.JobResponse = out @@ -192,7 +196,7 @@ func (s *jobs) GetJob(ctx context.Context, request operations.GetJobRequest) (*o case utils.MatchContentType(contentType, `application/json`): var out *shared.JobResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.JobResponse = out @@ -251,7 +255,7 @@ func (s *jobs) ListJobs(ctx context.Context, request operations.ListJobsRequest) case utils.MatchContentType(contentType, `application/json`): var out *shared.JobsResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.JobsResponse = out diff --git a/internal/sdk/sdk.go b/internal/sdk/sdk.go index bd6a29384..e410460da 100755 --- a/internal/sdk/sdk.go +++ b/internal/sdk/sdk.go @@ -122,8 +122,8 @@ func New(opts ...SDKOption) *SDK { sdkConfiguration: sdkConfiguration{ Language: "terraform", OpenAPIDocVersion: "1.0.0", - SDKVersion: "0.3.1", - GenVersion: "2.83.3", + SDKVersion: "0.3.2", + GenVersion: "2.84.3", }, } for _, opt := range opts { diff --git a/internal/sdk/sources.go b/internal/sdk/sources.go index 18f495601..765f152e5 100755 --- a/internal/sdk/sources.go +++ b/internal/sdk/sources.go @@ -35,7 +35,10 @@ func (s *sources) CreateSource(ctx context.Context, request shared.SourceCreateR return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -58,6 +61,7 @@ func (s *sources) CreateSource(ctx context.Context, request shared.SourceCreateR if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -74,7 +78,7 @@ func (s *sources) CreateSource(ctx context.Context, request shared.SourceCreateR case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -98,7 +102,10 @@ func (s *sources) CreateSourceAircall(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -121,6 +128,7 @@ func (s *sources) CreateSourceAircall(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -137,7 +145,7 @@ func (s *sources) CreateSourceAircall(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -161,7 +169,10 @@ func (s *sources) CreateSourceAirtable(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -184,6 +195,7 @@ func (s *sources) CreateSourceAirtable(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -200,7 +212,7 @@ func (s *sources) CreateSourceAirtable(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -224,7 +236,10 @@ func (s *sources) CreateSourceAlloydb(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -247,6 +262,7 @@ func (s *sources) CreateSourceAlloydb(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -263,7 +279,7 @@ func (s *sources) CreateSourceAlloydb(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -287,7 +303,10 @@ func (s *sources) CreateSourceAmazonAds(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -310,6 +329,7 @@ func (s *sources) CreateSourceAmazonAds(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -326,7 +346,7 @@ func (s *sources) CreateSourceAmazonAds(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -350,7 +370,10 @@ func (s *sources) CreateSourceAmazonSqs(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -373,6 +396,7 @@ func (s *sources) CreateSourceAmazonSqs(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -389,7 +413,7 @@ func (s *sources) CreateSourceAmazonSqs(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -413,7 +437,10 @@ func (s *sources) CreateSourceAmplitude(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -436,6 +463,7 @@ func (s *sources) CreateSourceAmplitude(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -452,7 +480,7 @@ func (s *sources) CreateSourceAmplitude(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -476,7 +504,10 @@ func (s *sources) CreateSourceApifyDataset(ctx context.Context, request shared.S return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -499,6 +530,7 @@ func (s *sources) CreateSourceApifyDataset(ctx context.Context, request shared.S if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -515,7 +547,7 @@ func (s *sources) CreateSourceApifyDataset(ctx context.Context, request shared.S case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -539,7 +571,10 @@ func (s *sources) CreateSourceAsana(ctx context.Context, request shared.SourceAs return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -562,6 +597,7 @@ func (s *sources) CreateSourceAsana(ctx context.Context, request shared.SourceAs if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -578,7 +614,7 @@ func (s *sources) CreateSourceAsana(ctx context.Context, request shared.SourceAs case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -602,7 +638,10 @@ func (s *sources) CreateSourceAuth0(ctx context.Context, request shared.SourceAu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -625,6 +664,7 @@ func (s *sources) CreateSourceAuth0(ctx context.Context, request shared.SourceAu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -641,7 +681,7 @@ func (s *sources) CreateSourceAuth0(ctx context.Context, request shared.SourceAu case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -665,7 +705,10 @@ func (s *sources) CreateSourceAwsCloudtrail(ctx context.Context, request shared. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -688,6 +731,7 @@ func (s *sources) CreateSourceAwsCloudtrail(ctx context.Context, request shared. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -704,7 +748,7 @@ func (s *sources) CreateSourceAwsCloudtrail(ctx context.Context, request shared. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -728,7 +772,10 @@ func (s *sources) CreateSourceAzureBlobStorage(ctx context.Context, request shar return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -751,6 +798,7 @@ func (s *sources) CreateSourceAzureBlobStorage(ctx context.Context, request shar if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -767,7 +815,7 @@ func (s *sources) CreateSourceAzureBlobStorage(ctx context.Context, request shar case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -791,7 +839,10 @@ func (s *sources) CreateSourceAzureTable(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -814,6 +865,7 @@ func (s *sources) CreateSourceAzureTable(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -830,7 +882,7 @@ func (s *sources) CreateSourceAzureTable(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -854,7 +906,10 @@ func (s *sources) CreateSourceBambooHr(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -877,6 +932,7 @@ func (s *sources) CreateSourceBambooHr(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -893,7 +949,7 @@ func (s *sources) CreateSourceBambooHr(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -917,7 +973,10 @@ func (s *sources) CreateSourceBigcommerce(ctx context.Context, request shared.So return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -940,6 +999,7 @@ func (s *sources) CreateSourceBigcommerce(ctx context.Context, request shared.So if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -956,7 +1016,7 @@ func (s *sources) CreateSourceBigcommerce(ctx context.Context, request shared.So case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -980,7 +1040,10 @@ func (s *sources) CreateSourceBigquery(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1003,6 +1066,7 @@ func (s *sources) CreateSourceBigquery(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1019,7 +1083,7 @@ func (s *sources) CreateSourceBigquery(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1043,7 +1107,10 @@ func (s *sources) CreateSourceBingAds(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1066,6 +1133,7 @@ func (s *sources) CreateSourceBingAds(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1082,7 +1150,7 @@ func (s *sources) CreateSourceBingAds(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1106,7 +1174,10 @@ func (s *sources) CreateSourceBraintree(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1129,6 +1200,7 @@ func (s *sources) CreateSourceBraintree(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1145,7 +1217,7 @@ func (s *sources) CreateSourceBraintree(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1169,7 +1241,10 @@ func (s *sources) CreateSourceBraze(ctx context.Context, request shared.SourceBr return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1192,6 +1267,7 @@ func (s *sources) CreateSourceBraze(ctx context.Context, request shared.SourceBr if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1208,7 +1284,7 @@ func (s *sources) CreateSourceBraze(ctx context.Context, request shared.SourceBr case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1232,7 +1308,10 @@ func (s *sources) CreateSourceChargebee(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1255,6 +1334,7 @@ func (s *sources) CreateSourceChargebee(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1271,7 +1351,7 @@ func (s *sources) CreateSourceChargebee(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1295,7 +1375,10 @@ func (s *sources) CreateSourceChartmogul(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1318,6 +1401,7 @@ func (s *sources) CreateSourceChartmogul(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1334,7 +1418,7 @@ func (s *sources) CreateSourceChartmogul(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1358,7 +1442,10 @@ func (s *sources) CreateSourceClickhouse(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1381,6 +1468,7 @@ func (s *sources) CreateSourceClickhouse(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1397,7 +1485,7 @@ func (s *sources) CreateSourceClickhouse(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1421,7 +1509,10 @@ func (s *sources) CreateSourceClickupAPI(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1444,6 +1535,7 @@ func (s *sources) CreateSourceClickupAPI(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1460,7 +1552,7 @@ func (s *sources) CreateSourceClickupAPI(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1484,7 +1576,10 @@ func (s *sources) CreateSourceCloseCom(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1507,6 +1602,7 @@ func (s *sources) CreateSourceCloseCom(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1523,7 +1619,7 @@ func (s *sources) CreateSourceCloseCom(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1547,7 +1643,10 @@ func (s *sources) CreateSourceCoda(ctx context.Context, request shared.SourceCod return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1570,6 +1669,7 @@ func (s *sources) CreateSourceCoda(ctx context.Context, request shared.SourceCod if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1586,7 +1686,7 @@ func (s *sources) CreateSourceCoda(ctx context.Context, request shared.SourceCod case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1610,7 +1710,10 @@ func (s *sources) CreateSourceCoinAPI(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1633,6 +1736,7 @@ func (s *sources) CreateSourceCoinAPI(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1649,7 +1753,7 @@ func (s *sources) CreateSourceCoinAPI(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1673,7 +1777,10 @@ func (s *sources) CreateSourceCoinmarketcap(ctx context.Context, request shared. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1696,6 +1803,7 @@ func (s *sources) CreateSourceCoinmarketcap(ctx context.Context, request shared. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1712,7 +1820,7 @@ func (s *sources) CreateSourceCoinmarketcap(ctx context.Context, request shared. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1736,7 +1844,10 @@ func (s *sources) CreateSourceConfigcat(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1759,6 +1870,7 @@ func (s *sources) CreateSourceConfigcat(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1775,7 +1887,7 @@ func (s *sources) CreateSourceConfigcat(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1799,7 +1911,10 @@ func (s *sources) CreateSourceConfluence(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1822,6 +1937,7 @@ func (s *sources) CreateSourceConfluence(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1838,7 +1954,7 @@ func (s *sources) CreateSourceConfluence(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1862,7 +1978,10 @@ func (s *sources) CreateSourceDatascope(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1885,6 +2004,7 @@ func (s *sources) CreateSourceDatascope(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1901,7 +2021,7 @@ func (s *sources) CreateSourceDatascope(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1925,7 +2045,10 @@ func (s *sources) CreateSourceDelighted(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -1948,6 +2071,7 @@ func (s *sources) CreateSourceDelighted(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -1964,7 +2088,7 @@ func (s *sources) CreateSourceDelighted(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -1988,7 +2112,10 @@ func (s *sources) CreateSourceDixa(ctx context.Context, request shared.SourceDix return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2011,6 +2138,7 @@ func (s *sources) CreateSourceDixa(ctx context.Context, request shared.SourceDix if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2027,7 +2155,7 @@ func (s *sources) CreateSourceDixa(ctx context.Context, request shared.SourceDix case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2051,7 +2179,10 @@ func (s *sources) CreateSourceDockerhub(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2074,6 +2205,7 @@ func (s *sources) CreateSourceDockerhub(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2090,7 +2222,7 @@ func (s *sources) CreateSourceDockerhub(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2114,7 +2246,10 @@ func (s *sources) CreateSourceDremio(ctx context.Context, request shared.SourceD return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2137,6 +2272,7 @@ func (s *sources) CreateSourceDremio(ctx context.Context, request shared.SourceD if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2153,7 +2289,7 @@ func (s *sources) CreateSourceDremio(ctx context.Context, request shared.SourceD case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2177,7 +2313,10 @@ func (s *sources) CreateSourceDynamodb(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2200,6 +2339,7 @@ func (s *sources) CreateSourceDynamodb(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2216,7 +2356,7 @@ func (s *sources) CreateSourceDynamodb(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2240,7 +2380,10 @@ func (s *sources) CreateSourceE2eTestCloud(ctx context.Context, request shared.S return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2263,6 +2406,7 @@ func (s *sources) CreateSourceE2eTestCloud(ctx context.Context, request shared.S if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2279,7 +2423,7 @@ func (s *sources) CreateSourceE2eTestCloud(ctx context.Context, request shared.S case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2303,7 +2447,10 @@ func (s *sources) CreateSourceEmailoctopus(ctx context.Context, request shared.S return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2326,6 +2473,7 @@ func (s *sources) CreateSourceEmailoctopus(ctx context.Context, request shared.S if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2342,7 +2490,7 @@ func (s *sources) CreateSourceEmailoctopus(ctx context.Context, request shared.S case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2366,7 +2514,10 @@ func (s *sources) CreateSourceExchangeRates(ctx context.Context, request shared. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2389,6 +2540,7 @@ func (s *sources) CreateSourceExchangeRates(ctx context.Context, request shared. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2405,7 +2557,7 @@ func (s *sources) CreateSourceExchangeRates(ctx context.Context, request shared. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2429,7 +2581,10 @@ func (s *sources) CreateSourceFacebookMarketing(ctx context.Context, request sha return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2452,6 +2607,7 @@ func (s *sources) CreateSourceFacebookMarketing(ctx context.Context, request sha if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2468,7 +2624,7 @@ func (s *sources) CreateSourceFacebookMarketing(ctx context.Context, request sha case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2492,7 +2648,10 @@ func (s *sources) CreateSourceFacebookPages(ctx context.Context, request shared. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2515,6 +2674,7 @@ func (s *sources) CreateSourceFacebookPages(ctx context.Context, request shared. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2531,7 +2691,7 @@ func (s *sources) CreateSourceFacebookPages(ctx context.Context, request shared. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2555,7 +2715,10 @@ func (s *sources) CreateSourceFaker(ctx context.Context, request shared.SourceFa return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2578,6 +2741,7 @@ func (s *sources) CreateSourceFaker(ctx context.Context, request shared.SourceFa if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2594,7 +2758,7 @@ func (s *sources) CreateSourceFaker(ctx context.Context, request shared.SourceFa case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2618,7 +2782,10 @@ func (s *sources) CreateSourceFauna(ctx context.Context, request shared.SourceFa return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2641,6 +2808,7 @@ func (s *sources) CreateSourceFauna(ctx context.Context, request shared.SourceFa if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2657,7 +2825,7 @@ func (s *sources) CreateSourceFauna(ctx context.Context, request shared.SourceFa case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2681,7 +2849,10 @@ func (s *sources) CreateSourceFileSecure(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2704,6 +2875,7 @@ func (s *sources) CreateSourceFileSecure(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2720,7 +2892,7 @@ func (s *sources) CreateSourceFileSecure(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2744,7 +2916,10 @@ func (s *sources) CreateSourceFirebolt(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2767,6 +2942,7 @@ func (s *sources) CreateSourceFirebolt(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2783,7 +2959,7 @@ func (s *sources) CreateSourceFirebolt(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2807,7 +2983,10 @@ func (s *sources) CreateSourceFreshcaller(ctx context.Context, request shared.So return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2830,6 +3009,7 @@ func (s *sources) CreateSourceFreshcaller(ctx context.Context, request shared.So if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2846,7 +3026,7 @@ func (s *sources) CreateSourceFreshcaller(ctx context.Context, request shared.So case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2870,7 +3050,10 @@ func (s *sources) CreateSourceFreshdesk(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2893,6 +3076,7 @@ func (s *sources) CreateSourceFreshdesk(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2909,7 +3093,7 @@ func (s *sources) CreateSourceFreshdesk(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2933,7 +3117,10 @@ func (s *sources) CreateSourceFreshsales(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2956,6 +3143,7 @@ func (s *sources) CreateSourceFreshsales(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -2972,7 +3160,7 @@ func (s *sources) CreateSourceFreshsales(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -2996,7 +3184,10 @@ func (s *sources) CreateSourceFreshservice(ctx context.Context, request shared.S return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3019,6 +3210,7 @@ func (s *sources) CreateSourceFreshservice(ctx context.Context, request shared.S if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3035,7 +3227,7 @@ func (s *sources) CreateSourceFreshservice(ctx context.Context, request shared.S case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3059,7 +3251,10 @@ func (s *sources) CreateSourceGcs(ctx context.Context, request shared.SourceGcsC return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3082,6 +3277,7 @@ func (s *sources) CreateSourceGcs(ctx context.Context, request shared.SourceGcsC if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3098,7 +3294,7 @@ func (s *sources) CreateSourceGcs(ctx context.Context, request shared.SourceGcsC case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3122,7 +3318,10 @@ func (s *sources) CreateSourceGetlago(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3145,6 +3344,7 @@ func (s *sources) CreateSourceGetlago(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3161,7 +3361,7 @@ func (s *sources) CreateSourceGetlago(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3185,7 +3385,10 @@ func (s *sources) CreateSourceGithub(ctx context.Context, request shared.SourceG return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3208,6 +3411,7 @@ func (s *sources) CreateSourceGithub(ctx context.Context, request shared.SourceG if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3224,7 +3428,7 @@ func (s *sources) CreateSourceGithub(ctx context.Context, request shared.SourceG case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3248,7 +3452,10 @@ func (s *sources) CreateSourceGitlab(ctx context.Context, request shared.SourceG return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3271,6 +3478,7 @@ func (s *sources) CreateSourceGitlab(ctx context.Context, request shared.SourceG if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3287,7 +3495,7 @@ func (s *sources) CreateSourceGitlab(ctx context.Context, request shared.SourceG case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3311,7 +3519,10 @@ func (s *sources) CreateSourceGlassfrog(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3334,6 +3545,7 @@ func (s *sources) CreateSourceGlassfrog(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3350,7 +3562,7 @@ func (s *sources) CreateSourceGlassfrog(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3374,7 +3586,10 @@ func (s *sources) CreateSourceGnews(ctx context.Context, request shared.SourceGn return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3397,6 +3612,7 @@ func (s *sources) CreateSourceGnews(ctx context.Context, request shared.SourceGn if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3413,7 +3629,7 @@ func (s *sources) CreateSourceGnews(ctx context.Context, request shared.SourceGn case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3437,7 +3653,10 @@ func (s *sources) CreateSourceGoogleAds(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3460,6 +3679,7 @@ func (s *sources) CreateSourceGoogleAds(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3476,7 +3696,7 @@ func (s *sources) CreateSourceGoogleAds(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3500,7 +3720,10 @@ func (s *sources) CreateSourceGoogleAnalyticsDataAPI(ctx context.Context, reques return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3523,6 +3746,7 @@ func (s *sources) CreateSourceGoogleAnalyticsDataAPI(ctx context.Context, reques if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3539,7 +3763,7 @@ func (s *sources) CreateSourceGoogleAnalyticsDataAPI(ctx context.Context, reques case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3563,7 +3787,10 @@ func (s *sources) CreateSourceGoogleAnalyticsV4(ctx context.Context, request sha return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3586,6 +3813,7 @@ func (s *sources) CreateSourceGoogleAnalyticsV4(ctx context.Context, request sha if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3602,7 +3830,7 @@ func (s *sources) CreateSourceGoogleAnalyticsV4(ctx context.Context, request sha case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3626,7 +3854,10 @@ func (s *sources) CreateSourceGoogleDirectory(ctx context.Context, request share return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3649,6 +3880,7 @@ func (s *sources) CreateSourceGoogleDirectory(ctx context.Context, request share if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3665,7 +3897,7 @@ func (s *sources) CreateSourceGoogleDirectory(ctx context.Context, request share case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3689,7 +3921,10 @@ func (s *sources) CreateSourceGooglePagespeedInsights(ctx context.Context, reque return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3712,6 +3947,7 @@ func (s *sources) CreateSourceGooglePagespeedInsights(ctx context.Context, reque if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3728,7 +3964,7 @@ func (s *sources) CreateSourceGooglePagespeedInsights(ctx context.Context, reque case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3752,7 +3988,10 @@ func (s *sources) CreateSourceGoogleSearchConsole(ctx context.Context, request s return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3775,6 +4014,7 @@ func (s *sources) CreateSourceGoogleSearchConsole(ctx context.Context, request s if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3791,7 +4031,7 @@ func (s *sources) CreateSourceGoogleSearchConsole(ctx context.Context, request s case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3815,7 +4055,10 @@ func (s *sources) CreateSourceGoogleSheets(ctx context.Context, request shared.S return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3838,6 +4081,7 @@ func (s *sources) CreateSourceGoogleSheets(ctx context.Context, request shared.S if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3854,7 +4098,7 @@ func (s *sources) CreateSourceGoogleSheets(ctx context.Context, request shared.S case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3878,7 +4122,10 @@ func (s *sources) CreateSourceGoogleWebfonts(ctx context.Context, request shared return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3901,6 +4148,7 @@ func (s *sources) CreateSourceGoogleWebfonts(ctx context.Context, request shared if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3917,7 +4165,7 @@ func (s *sources) CreateSourceGoogleWebfonts(ctx context.Context, request shared case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -3941,7 +4189,10 @@ func (s *sources) CreateSourceGoogleWorkspaceAdminReports(ctx context.Context, r return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -3964,6 +4215,7 @@ func (s *sources) CreateSourceGoogleWorkspaceAdminReports(ctx context.Context, r if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -3980,7 +4232,7 @@ func (s *sources) CreateSourceGoogleWorkspaceAdminReports(ctx context.Context, r case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4004,7 +4256,10 @@ func (s *sources) CreateSourceGreenhouse(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4027,6 +4282,7 @@ func (s *sources) CreateSourceGreenhouse(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4043,7 +4299,7 @@ func (s *sources) CreateSourceGreenhouse(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4067,7 +4323,10 @@ func (s *sources) CreateSourceGridly(ctx context.Context, request shared.SourceG return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4090,6 +4349,7 @@ func (s *sources) CreateSourceGridly(ctx context.Context, request shared.SourceG if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4106,7 +4366,7 @@ func (s *sources) CreateSourceGridly(ctx context.Context, request shared.SourceG case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4130,7 +4390,10 @@ func (s *sources) CreateSourceHarvest(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4153,6 +4416,7 @@ func (s *sources) CreateSourceHarvest(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4169,7 +4433,7 @@ func (s *sources) CreateSourceHarvest(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4193,7 +4457,10 @@ func (s *sources) CreateSourceHubplanner(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4216,6 +4483,7 @@ func (s *sources) CreateSourceHubplanner(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4232,7 +4500,7 @@ func (s *sources) CreateSourceHubplanner(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4256,7 +4524,10 @@ func (s *sources) CreateSourceHubspot(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4279,6 +4550,7 @@ func (s *sources) CreateSourceHubspot(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4295,7 +4567,7 @@ func (s *sources) CreateSourceHubspot(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4319,7 +4591,10 @@ func (s *sources) CreateSourceInsightly(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4342,6 +4617,7 @@ func (s *sources) CreateSourceInsightly(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4358,7 +4634,7 @@ func (s *sources) CreateSourceInsightly(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4382,7 +4658,10 @@ func (s *sources) CreateSourceInstagram(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4405,6 +4684,7 @@ func (s *sources) CreateSourceInstagram(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4421,7 +4701,7 @@ func (s *sources) CreateSourceInstagram(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4445,7 +4725,10 @@ func (s *sources) CreateSourceInstatus(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4468,6 +4751,7 @@ func (s *sources) CreateSourceInstatus(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4484,7 +4768,7 @@ func (s *sources) CreateSourceInstatus(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4508,7 +4792,10 @@ func (s *sources) CreateSourceIntercom(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4531,6 +4818,7 @@ func (s *sources) CreateSourceIntercom(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4547,7 +4835,7 @@ func (s *sources) CreateSourceIntercom(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4571,7 +4859,10 @@ func (s *sources) CreateSourceIp2whois(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4594,6 +4885,7 @@ func (s *sources) CreateSourceIp2whois(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4610,7 +4902,7 @@ func (s *sources) CreateSourceIp2whois(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4634,7 +4926,10 @@ func (s *sources) CreateSourceIterable(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4657,6 +4952,7 @@ func (s *sources) CreateSourceIterable(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4673,7 +4969,7 @@ func (s *sources) CreateSourceIterable(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4697,7 +4993,10 @@ func (s *sources) CreateSourceJira(ctx context.Context, request shared.SourceJir return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4720,6 +5019,7 @@ func (s *sources) CreateSourceJira(ctx context.Context, request shared.SourceJir if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4736,7 +5036,7 @@ func (s *sources) CreateSourceJira(ctx context.Context, request shared.SourceJir case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4760,7 +5060,10 @@ func (s *sources) CreateSourceK6Cloud(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4783,6 +5086,7 @@ func (s *sources) CreateSourceK6Cloud(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4799,7 +5103,7 @@ func (s *sources) CreateSourceK6Cloud(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4823,7 +5127,10 @@ func (s *sources) CreateSourceKlarna(ctx context.Context, request shared.SourceK return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4846,6 +5153,7 @@ func (s *sources) CreateSourceKlarna(ctx context.Context, request shared.SourceK if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4862,7 +5170,7 @@ func (s *sources) CreateSourceKlarna(ctx context.Context, request shared.SourceK case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4886,7 +5194,10 @@ func (s *sources) CreateSourceKlaviyo(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4909,6 +5220,7 @@ func (s *sources) CreateSourceKlaviyo(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4925,7 +5237,7 @@ func (s *sources) CreateSourceKlaviyo(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -4949,7 +5261,10 @@ func (s *sources) CreateSourceKustomerSinger(ctx context.Context, request shared return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -4972,6 +5287,7 @@ func (s *sources) CreateSourceKustomerSinger(ctx context.Context, request shared if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -4988,7 +5304,7 @@ func (s *sources) CreateSourceKustomerSinger(ctx context.Context, request shared case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5012,7 +5328,10 @@ func (s *sources) CreateSourceLaunchdarkly(ctx context.Context, request shared.S return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5035,6 +5354,7 @@ func (s *sources) CreateSourceLaunchdarkly(ctx context.Context, request shared.S if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5051,7 +5371,7 @@ func (s *sources) CreateSourceLaunchdarkly(ctx context.Context, request shared.S case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5075,7 +5395,10 @@ func (s *sources) CreateSourceLemlist(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5098,6 +5421,7 @@ func (s *sources) CreateSourceLemlist(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5114,7 +5438,7 @@ func (s *sources) CreateSourceLemlist(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5138,7 +5462,10 @@ func (s *sources) CreateSourceLinkedinAds(ctx context.Context, request shared.So return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5161,6 +5488,7 @@ func (s *sources) CreateSourceLinkedinAds(ctx context.Context, request shared.So if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5177,7 +5505,7 @@ func (s *sources) CreateSourceLinkedinAds(ctx context.Context, request shared.So case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5201,7 +5529,10 @@ func (s *sources) CreateSourceLinkedinPages(ctx context.Context, request shared. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5224,6 +5555,7 @@ func (s *sources) CreateSourceLinkedinPages(ctx context.Context, request shared. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5240,7 +5572,7 @@ func (s *sources) CreateSourceLinkedinPages(ctx context.Context, request shared. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5264,7 +5596,10 @@ func (s *sources) CreateSourceLinnworks(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5287,6 +5622,7 @@ func (s *sources) CreateSourceLinnworks(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5303,7 +5639,7 @@ func (s *sources) CreateSourceLinnworks(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5327,7 +5663,10 @@ func (s *sources) CreateSourceLokalise(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5350,6 +5689,7 @@ func (s *sources) CreateSourceLokalise(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5366,7 +5706,7 @@ func (s *sources) CreateSourceLokalise(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5390,7 +5730,10 @@ func (s *sources) CreateSourceMailchimp(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5413,6 +5756,7 @@ func (s *sources) CreateSourceMailchimp(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5429,7 +5773,7 @@ func (s *sources) CreateSourceMailchimp(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5453,7 +5797,10 @@ func (s *sources) CreateSourceMailgun(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5476,6 +5823,7 @@ func (s *sources) CreateSourceMailgun(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5492,7 +5840,7 @@ func (s *sources) CreateSourceMailgun(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5516,7 +5864,10 @@ func (s *sources) CreateSourceMailjetSms(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5539,6 +5890,7 @@ func (s *sources) CreateSourceMailjetSms(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5555,7 +5907,7 @@ func (s *sources) CreateSourceMailjetSms(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5579,7 +5931,10 @@ func (s *sources) CreateSourceMarketo(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5602,6 +5957,7 @@ func (s *sources) CreateSourceMarketo(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5618,7 +5974,7 @@ func (s *sources) CreateSourceMarketo(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5642,7 +5998,10 @@ func (s *sources) CreateSourceMetabase(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5665,6 +6024,7 @@ func (s *sources) CreateSourceMetabase(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5681,7 +6041,7 @@ func (s *sources) CreateSourceMetabase(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5705,7 +6065,10 @@ func (s *sources) CreateSourceMicrosoftTeams(ctx context.Context, request shared return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5728,6 +6091,7 @@ func (s *sources) CreateSourceMicrosoftTeams(ctx context.Context, request shared if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5744,7 +6108,7 @@ func (s *sources) CreateSourceMicrosoftTeams(ctx context.Context, request shared case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5768,7 +6132,10 @@ func (s *sources) CreateSourceMixpanel(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5791,6 +6158,7 @@ func (s *sources) CreateSourceMixpanel(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5807,7 +6175,7 @@ func (s *sources) CreateSourceMixpanel(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5831,7 +6199,10 @@ func (s *sources) CreateSourceMonday(ctx context.Context, request shared.SourceM return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5854,6 +6225,7 @@ func (s *sources) CreateSourceMonday(ctx context.Context, request shared.SourceM if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5870,7 +6242,7 @@ func (s *sources) CreateSourceMonday(ctx context.Context, request shared.SourceM case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5894,7 +6266,10 @@ func (s *sources) CreateSourceMongodb(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5917,6 +6292,7 @@ func (s *sources) CreateSourceMongodb(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5933,7 +6309,7 @@ func (s *sources) CreateSourceMongodb(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -5957,7 +6333,10 @@ func (s *sources) CreateSourceMssql(ctx context.Context, request shared.SourceMs return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -5980,6 +6359,7 @@ func (s *sources) CreateSourceMssql(ctx context.Context, request shared.SourceMs if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -5996,7 +6376,7 @@ func (s *sources) CreateSourceMssql(ctx context.Context, request shared.SourceMs case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6020,7 +6400,10 @@ func (s *sources) CreateSourceMyHours(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6043,6 +6426,7 @@ func (s *sources) CreateSourceMyHours(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6059,7 +6443,7 @@ func (s *sources) CreateSourceMyHours(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6083,7 +6467,10 @@ func (s *sources) CreateSourceMysql(ctx context.Context, request shared.SourceMy return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6106,6 +6493,7 @@ func (s *sources) CreateSourceMysql(ctx context.Context, request shared.SourceMy if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6122,7 +6510,7 @@ func (s *sources) CreateSourceMysql(ctx context.Context, request shared.SourceMy case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6146,7 +6534,10 @@ func (s *sources) CreateSourceNetsuite(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6169,6 +6560,7 @@ func (s *sources) CreateSourceNetsuite(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6185,7 +6577,7 @@ func (s *sources) CreateSourceNetsuite(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6209,7 +6601,10 @@ func (s *sources) CreateSourceNotion(ctx context.Context, request shared.SourceN return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6232,6 +6627,7 @@ func (s *sources) CreateSourceNotion(ctx context.Context, request shared.SourceN if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6248,7 +6644,7 @@ func (s *sources) CreateSourceNotion(ctx context.Context, request shared.SourceN case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6272,7 +6668,10 @@ func (s *sources) CreateSourceNytimes(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6295,6 +6694,7 @@ func (s *sources) CreateSourceNytimes(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6311,7 +6711,7 @@ func (s *sources) CreateSourceNytimes(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6335,7 +6735,10 @@ func (s *sources) CreateSourceOkta(ctx context.Context, request shared.SourceOkt return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6358,6 +6761,7 @@ func (s *sources) CreateSourceOkta(ctx context.Context, request shared.SourceOkt if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6374,7 +6778,7 @@ func (s *sources) CreateSourceOkta(ctx context.Context, request shared.SourceOkt case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6398,7 +6802,10 @@ func (s *sources) CreateSourceOmnisend(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6421,6 +6828,7 @@ func (s *sources) CreateSourceOmnisend(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6437,7 +6845,7 @@ func (s *sources) CreateSourceOmnisend(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6461,7 +6869,10 @@ func (s *sources) CreateSourceOnesignal(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6484,6 +6895,7 @@ func (s *sources) CreateSourceOnesignal(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6500,7 +6912,7 @@ func (s *sources) CreateSourceOnesignal(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6524,7 +6936,10 @@ func (s *sources) CreateSourceOpenweather(ctx context.Context, request shared.So return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6547,6 +6962,7 @@ func (s *sources) CreateSourceOpenweather(ctx context.Context, request shared.So if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6563,7 +6979,7 @@ func (s *sources) CreateSourceOpenweather(ctx context.Context, request shared.So case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6587,7 +7003,10 @@ func (s *sources) CreateSourceOracle(ctx context.Context, request shared.SourceO return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6610,6 +7029,7 @@ func (s *sources) CreateSourceOracle(ctx context.Context, request shared.SourceO if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6626,7 +7046,7 @@ func (s *sources) CreateSourceOracle(ctx context.Context, request shared.SourceO case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6650,7 +7070,10 @@ func (s *sources) CreateSourceOrb(ctx context.Context, request shared.SourceOrbC return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6673,6 +7096,7 @@ func (s *sources) CreateSourceOrb(ctx context.Context, request shared.SourceOrbC if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6689,7 +7113,7 @@ func (s *sources) CreateSourceOrb(ctx context.Context, request shared.SourceOrbC case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6713,7 +7137,10 @@ func (s *sources) CreateSourceOrbit(ctx context.Context, request shared.SourceOr return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6736,6 +7163,7 @@ func (s *sources) CreateSourceOrbit(ctx context.Context, request shared.SourceOr if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6752,7 +7180,7 @@ func (s *sources) CreateSourceOrbit(ctx context.Context, request shared.SourceOr case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6776,7 +7204,10 @@ func (s *sources) CreateSourceOutreach(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6799,6 +7230,7 @@ func (s *sources) CreateSourceOutreach(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6815,7 +7247,7 @@ func (s *sources) CreateSourceOutreach(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6839,7 +7271,10 @@ func (s *sources) CreateSourcePaypalTransaction(ctx context.Context, request sha return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6862,6 +7297,7 @@ func (s *sources) CreateSourcePaypalTransaction(ctx context.Context, request sha if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6878,7 +7314,7 @@ func (s *sources) CreateSourcePaypalTransaction(ctx context.Context, request sha case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6902,7 +7338,10 @@ func (s *sources) CreateSourcePaystack(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6925,6 +7364,7 @@ func (s *sources) CreateSourcePaystack(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -6941,7 +7381,7 @@ func (s *sources) CreateSourcePaystack(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -6965,7 +7405,10 @@ func (s *sources) CreateSourcePendo(ctx context.Context, request shared.SourcePe return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -6988,6 +7431,7 @@ func (s *sources) CreateSourcePendo(ctx context.Context, request shared.SourcePe if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7004,7 +7448,7 @@ func (s *sources) CreateSourcePendo(ctx context.Context, request shared.SourcePe case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7028,7 +7472,10 @@ func (s *sources) CreateSourcePersistiq(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7051,6 +7498,7 @@ func (s *sources) CreateSourcePersistiq(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7067,7 +7515,7 @@ func (s *sources) CreateSourcePersistiq(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7091,7 +7539,10 @@ func (s *sources) CreateSourcePexelsAPI(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7114,6 +7565,7 @@ func (s *sources) CreateSourcePexelsAPI(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7130,7 +7582,7 @@ func (s *sources) CreateSourcePexelsAPI(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7154,7 +7606,10 @@ func (s *sources) CreateSourcePinterest(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7177,6 +7632,7 @@ func (s *sources) CreateSourcePinterest(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7193,7 +7649,7 @@ func (s *sources) CreateSourcePinterest(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7217,7 +7673,10 @@ func (s *sources) CreateSourcePipedrive(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7240,6 +7699,7 @@ func (s *sources) CreateSourcePipedrive(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7256,7 +7716,7 @@ func (s *sources) CreateSourcePipedrive(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7280,7 +7740,10 @@ func (s *sources) CreateSourcePocket(ctx context.Context, request shared.SourceP return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7303,6 +7766,7 @@ func (s *sources) CreateSourcePocket(ctx context.Context, request shared.SourceP if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7319,7 +7783,7 @@ func (s *sources) CreateSourcePocket(ctx context.Context, request shared.SourceP case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7343,7 +7807,10 @@ func (s *sources) CreateSourcePokeapi(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7366,6 +7833,7 @@ func (s *sources) CreateSourcePokeapi(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7382,7 +7850,7 @@ func (s *sources) CreateSourcePokeapi(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7406,7 +7874,10 @@ func (s *sources) CreateSourcePolygonStockAPI(ctx context.Context, request share return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7429,6 +7900,7 @@ func (s *sources) CreateSourcePolygonStockAPI(ctx context.Context, request share if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7445,7 +7917,7 @@ func (s *sources) CreateSourcePolygonStockAPI(ctx context.Context, request share case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7469,7 +7941,10 @@ func (s *sources) CreateSourcePostgres(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7492,6 +7967,7 @@ func (s *sources) CreateSourcePostgres(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7508,7 +7984,7 @@ func (s *sources) CreateSourcePostgres(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7532,7 +8008,10 @@ func (s *sources) CreateSourcePosthog(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7555,6 +8034,7 @@ func (s *sources) CreateSourcePosthog(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7571,7 +8051,7 @@ func (s *sources) CreateSourcePosthog(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7595,7 +8075,10 @@ func (s *sources) CreateSourcePostmarkapp(ctx context.Context, request shared.So return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7618,6 +8101,7 @@ func (s *sources) CreateSourcePostmarkapp(ctx context.Context, request shared.So if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7634,7 +8118,7 @@ func (s *sources) CreateSourcePostmarkapp(ctx context.Context, request shared.So case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7658,7 +8142,10 @@ func (s *sources) CreateSourcePrestashop(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7681,6 +8168,7 @@ func (s *sources) CreateSourcePrestashop(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7697,7 +8185,7 @@ func (s *sources) CreateSourcePrestashop(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7721,7 +8209,10 @@ func (s *sources) CreateSourcePublicApis(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7744,6 +8235,7 @@ func (s *sources) CreateSourcePublicApis(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7760,7 +8252,7 @@ func (s *sources) CreateSourcePublicApis(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7784,7 +8276,10 @@ func (s *sources) CreateSourcePunkAPI(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7807,6 +8302,7 @@ func (s *sources) CreateSourcePunkAPI(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7823,7 +8319,7 @@ func (s *sources) CreateSourcePunkAPI(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7847,7 +8343,10 @@ func (s *sources) CreateSourcePypi(ctx context.Context, request shared.SourcePyp return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7870,6 +8369,7 @@ func (s *sources) CreateSourcePypi(ctx context.Context, request shared.SourcePyp if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7886,7 +8386,7 @@ func (s *sources) CreateSourcePypi(ctx context.Context, request shared.SourcePyp case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7910,7 +8410,10 @@ func (s *sources) CreateSourceQualaroo(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7933,6 +8436,7 @@ func (s *sources) CreateSourceQualaroo(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -7949,7 +8453,7 @@ func (s *sources) CreateSourceQualaroo(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -7973,7 +8477,10 @@ func (s *sources) CreateSourceQuickbooks(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -7996,6 +8503,7 @@ func (s *sources) CreateSourceQuickbooks(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8012,7 +8520,7 @@ func (s *sources) CreateSourceQuickbooks(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8036,7 +8544,10 @@ func (s *sources) CreateSourceRailz(ctx context.Context, request shared.SourceRa return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8059,6 +8570,7 @@ func (s *sources) CreateSourceRailz(ctx context.Context, request shared.SourceRa if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8075,7 +8587,7 @@ func (s *sources) CreateSourceRailz(ctx context.Context, request shared.SourceRa case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8099,7 +8611,10 @@ func (s *sources) CreateSourceRecharge(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8122,6 +8637,7 @@ func (s *sources) CreateSourceRecharge(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8138,7 +8654,7 @@ func (s *sources) CreateSourceRecharge(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8162,7 +8678,10 @@ func (s *sources) CreateSourceRecreation(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8185,6 +8704,7 @@ func (s *sources) CreateSourceRecreation(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8201,7 +8721,7 @@ func (s *sources) CreateSourceRecreation(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8225,7 +8745,10 @@ func (s *sources) CreateSourceRecruitee(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8248,6 +8771,7 @@ func (s *sources) CreateSourceRecruitee(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8264,7 +8788,7 @@ func (s *sources) CreateSourceRecruitee(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8288,7 +8812,10 @@ func (s *sources) CreateSourceRecurly(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8311,6 +8838,7 @@ func (s *sources) CreateSourceRecurly(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8327,7 +8855,7 @@ func (s *sources) CreateSourceRecurly(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8351,7 +8879,10 @@ func (s *sources) CreateSourceRedshift(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8374,6 +8905,7 @@ func (s *sources) CreateSourceRedshift(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8390,7 +8922,7 @@ func (s *sources) CreateSourceRedshift(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8414,7 +8946,10 @@ func (s *sources) CreateSourceRetently(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8437,6 +8972,7 @@ func (s *sources) CreateSourceRetently(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8453,7 +8989,7 @@ func (s *sources) CreateSourceRetently(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8477,7 +9013,10 @@ func (s *sources) CreateSourceRkiCovid(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8500,6 +9039,7 @@ func (s *sources) CreateSourceRkiCovid(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8516,7 +9056,7 @@ func (s *sources) CreateSourceRkiCovid(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8540,7 +9080,10 @@ func (s *sources) CreateSourceRss(ctx context.Context, request shared.SourceRssC return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8563,6 +9106,7 @@ func (s *sources) CreateSourceRss(ctx context.Context, request shared.SourceRssC if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8579,7 +9123,7 @@ func (s *sources) CreateSourceRss(ctx context.Context, request shared.SourceRssC case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8603,7 +9147,10 @@ func (s *sources) CreateSourceS3(ctx context.Context, request shared.SourceS3Cre return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8626,6 +9173,7 @@ func (s *sources) CreateSourceS3(ctx context.Context, request shared.SourceS3Cre if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8642,7 +9190,7 @@ func (s *sources) CreateSourceS3(ctx context.Context, request shared.SourceS3Cre case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8666,7 +9214,10 @@ func (s *sources) CreateSourceSalesforce(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8689,6 +9240,7 @@ func (s *sources) CreateSourceSalesforce(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8705,7 +9257,7 @@ func (s *sources) CreateSourceSalesforce(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8729,7 +9281,10 @@ func (s *sources) CreateSourceSalesforceSinger(ctx context.Context, request shar return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8752,6 +9307,7 @@ func (s *sources) CreateSourceSalesforceSinger(ctx context.Context, request shar if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8768,7 +9324,7 @@ func (s *sources) CreateSourceSalesforceSinger(ctx context.Context, request shar case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8792,7 +9348,10 @@ func (s *sources) CreateSourceSalesloft(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8815,6 +9374,7 @@ func (s *sources) CreateSourceSalesloft(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8831,7 +9391,7 @@ func (s *sources) CreateSourceSalesloft(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8855,7 +9415,10 @@ func (s *sources) CreateSourceSapFieldglass(ctx context.Context, request shared. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8878,6 +9441,7 @@ func (s *sources) CreateSourceSapFieldglass(ctx context.Context, request shared. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8894,7 +9458,7 @@ func (s *sources) CreateSourceSapFieldglass(ctx context.Context, request shared. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8918,7 +9482,10 @@ func (s *sources) CreateSourceSecoda(ctx context.Context, request shared.SourceS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -8941,6 +9508,7 @@ func (s *sources) CreateSourceSecoda(ctx context.Context, request shared.SourceS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -8957,7 +9525,7 @@ func (s *sources) CreateSourceSecoda(ctx context.Context, request shared.SourceS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -8981,7 +9549,10 @@ func (s *sources) CreateSourceSendgrid(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9004,6 +9575,7 @@ func (s *sources) CreateSourceSendgrid(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9020,7 +9592,7 @@ func (s *sources) CreateSourceSendgrid(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9044,7 +9616,10 @@ func (s *sources) CreateSourceSendinblue(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9067,6 +9642,7 @@ func (s *sources) CreateSourceSendinblue(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9083,7 +9659,7 @@ func (s *sources) CreateSourceSendinblue(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9107,7 +9683,10 @@ func (s *sources) CreateSourceSenseforce(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9130,6 +9709,7 @@ func (s *sources) CreateSourceSenseforce(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9146,7 +9726,7 @@ func (s *sources) CreateSourceSenseforce(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9170,7 +9750,10 @@ func (s *sources) CreateSourceSentry(ctx context.Context, request shared.SourceS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9193,6 +9776,7 @@ func (s *sources) CreateSourceSentry(ctx context.Context, request shared.SourceS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9209,7 +9793,7 @@ func (s *sources) CreateSourceSentry(ctx context.Context, request shared.SourceS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9233,7 +9817,10 @@ func (s *sources) CreateSourceSftp(ctx context.Context, request shared.SourceSft return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9256,6 +9843,7 @@ func (s *sources) CreateSourceSftp(ctx context.Context, request shared.SourceSft if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9272,7 +9860,7 @@ func (s *sources) CreateSourceSftp(ctx context.Context, request shared.SourceSft case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9296,7 +9884,10 @@ func (s *sources) CreateSourceSftpBulk(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9319,6 +9910,7 @@ func (s *sources) CreateSourceSftpBulk(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9335,7 +9927,7 @@ func (s *sources) CreateSourceSftpBulk(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9359,7 +9951,10 @@ func (s *sources) CreateSourceShopify(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9382,6 +9977,7 @@ func (s *sources) CreateSourceShopify(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9398,7 +9994,7 @@ func (s *sources) CreateSourceShopify(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9422,7 +10018,10 @@ func (s *sources) CreateSourceShortio(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9445,6 +10044,7 @@ func (s *sources) CreateSourceShortio(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9461,7 +10061,7 @@ func (s *sources) CreateSourceShortio(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9485,7 +10085,10 @@ func (s *sources) CreateSourceSlack(ctx context.Context, request shared.SourceSl return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9508,6 +10111,7 @@ func (s *sources) CreateSourceSlack(ctx context.Context, request shared.SourceSl if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9524,7 +10128,7 @@ func (s *sources) CreateSourceSlack(ctx context.Context, request shared.SourceSl case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9548,7 +10152,10 @@ func (s *sources) CreateSourceSmaily(ctx context.Context, request shared.SourceS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9571,6 +10178,7 @@ func (s *sources) CreateSourceSmaily(ctx context.Context, request shared.SourceS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9587,7 +10195,7 @@ func (s *sources) CreateSourceSmaily(ctx context.Context, request shared.SourceS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9611,7 +10219,10 @@ func (s *sources) CreateSourceSmartengage(ctx context.Context, request shared.So return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9634,6 +10245,7 @@ func (s *sources) CreateSourceSmartengage(ctx context.Context, request shared.So if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9650,7 +10262,7 @@ func (s *sources) CreateSourceSmartengage(ctx context.Context, request shared.So case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9674,7 +10286,10 @@ func (s *sources) CreateSourceSmartsheets(ctx context.Context, request shared.So return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9697,6 +10312,7 @@ func (s *sources) CreateSourceSmartsheets(ctx context.Context, request shared.So if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9713,7 +10329,7 @@ func (s *sources) CreateSourceSmartsheets(ctx context.Context, request shared.So case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9737,7 +10353,10 @@ func (s *sources) CreateSourceSnapchatMarketing(ctx context.Context, request sha return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9760,6 +10379,7 @@ func (s *sources) CreateSourceSnapchatMarketing(ctx context.Context, request sha if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9776,7 +10396,7 @@ func (s *sources) CreateSourceSnapchatMarketing(ctx context.Context, request sha case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9800,7 +10420,10 @@ func (s *sources) CreateSourceSnowflake(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9823,6 +10446,7 @@ func (s *sources) CreateSourceSnowflake(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9839,7 +10463,7 @@ func (s *sources) CreateSourceSnowflake(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9863,7 +10487,10 @@ func (s *sources) CreateSourceSonarCloud(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9886,6 +10513,7 @@ func (s *sources) CreateSourceSonarCloud(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9902,7 +10530,7 @@ func (s *sources) CreateSourceSonarCloud(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9926,7 +10554,10 @@ func (s *sources) CreateSourceSpacexAPI(ctx context.Context, request shared.Sour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -9949,6 +10580,7 @@ func (s *sources) CreateSourceSpacexAPI(ctx context.Context, request shared.Sour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -9965,7 +10597,7 @@ func (s *sources) CreateSourceSpacexAPI(ctx context.Context, request shared.Sour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -9989,7 +10621,10 @@ func (s *sources) CreateSourceSquare(ctx context.Context, request shared.SourceS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10012,6 +10647,7 @@ func (s *sources) CreateSourceSquare(ctx context.Context, request shared.SourceS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10028,7 +10664,7 @@ func (s *sources) CreateSourceSquare(ctx context.Context, request shared.SourceS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10052,7 +10688,10 @@ func (s *sources) CreateSourceStrava(ctx context.Context, request shared.SourceS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10075,6 +10714,7 @@ func (s *sources) CreateSourceStrava(ctx context.Context, request shared.SourceS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10091,7 +10731,7 @@ func (s *sources) CreateSourceStrava(ctx context.Context, request shared.SourceS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10115,7 +10755,10 @@ func (s *sources) CreateSourceStripe(ctx context.Context, request shared.SourceS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10138,6 +10781,7 @@ func (s *sources) CreateSourceStripe(ctx context.Context, request shared.SourceS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10154,7 +10798,7 @@ func (s *sources) CreateSourceStripe(ctx context.Context, request shared.SourceS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10178,7 +10822,10 @@ func (s *sources) CreateSourceSurveySparrow(ctx context.Context, request shared. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10201,6 +10848,7 @@ func (s *sources) CreateSourceSurveySparrow(ctx context.Context, request shared. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10217,7 +10865,7 @@ func (s *sources) CreateSourceSurveySparrow(ctx context.Context, request shared. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10241,7 +10889,10 @@ func (s *sources) CreateSourceSurveymonkey(ctx context.Context, request shared.S return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10264,6 +10915,7 @@ func (s *sources) CreateSourceSurveymonkey(ctx context.Context, request shared.S if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10280,7 +10932,7 @@ func (s *sources) CreateSourceSurveymonkey(ctx context.Context, request shared.S case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10304,7 +10956,10 @@ func (s *sources) CreateSourceTempo(ctx context.Context, request shared.SourceTe return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10327,6 +10982,7 @@ func (s *sources) CreateSourceTempo(ctx context.Context, request shared.SourceTe if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10343,7 +10999,7 @@ func (s *sources) CreateSourceTempo(ctx context.Context, request shared.SourceTe case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10367,7 +11023,10 @@ func (s *sources) CreateSourceTheGuardianAPI(ctx context.Context, request shared return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10390,6 +11049,7 @@ func (s *sources) CreateSourceTheGuardianAPI(ctx context.Context, request shared if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10406,7 +11066,7 @@ func (s *sources) CreateSourceTheGuardianAPI(ctx context.Context, request shared case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10430,7 +11090,10 @@ func (s *sources) CreateSourceTiktokMarketing(ctx context.Context, request share return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10453,6 +11116,7 @@ func (s *sources) CreateSourceTiktokMarketing(ctx context.Context, request share if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10469,7 +11133,7 @@ func (s *sources) CreateSourceTiktokMarketing(ctx context.Context, request share case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10493,7 +11157,10 @@ func (s *sources) CreateSourceTodoist(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10516,6 +11183,7 @@ func (s *sources) CreateSourceTodoist(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10532,7 +11200,7 @@ func (s *sources) CreateSourceTodoist(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10556,7 +11224,10 @@ func (s *sources) CreateSourceTrello(ctx context.Context, request shared.SourceT return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10579,6 +11250,7 @@ func (s *sources) CreateSourceTrello(ctx context.Context, request shared.SourceT if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10595,7 +11267,7 @@ func (s *sources) CreateSourceTrello(ctx context.Context, request shared.SourceT case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10619,7 +11291,10 @@ func (s *sources) CreateSourceTrustpilot(ctx context.Context, request shared.Sou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10642,6 +11317,7 @@ func (s *sources) CreateSourceTrustpilot(ctx context.Context, request shared.Sou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10658,7 +11334,7 @@ func (s *sources) CreateSourceTrustpilot(ctx context.Context, request shared.Sou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10682,7 +11358,10 @@ func (s *sources) CreateSourceTvmazeSchedule(ctx context.Context, request shared return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10705,6 +11384,7 @@ func (s *sources) CreateSourceTvmazeSchedule(ctx context.Context, request shared if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10721,7 +11401,7 @@ func (s *sources) CreateSourceTvmazeSchedule(ctx context.Context, request shared case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10745,7 +11425,10 @@ func (s *sources) CreateSourceTwilio(ctx context.Context, request shared.SourceT return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10768,6 +11451,7 @@ func (s *sources) CreateSourceTwilio(ctx context.Context, request shared.SourceT if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10784,7 +11468,7 @@ func (s *sources) CreateSourceTwilio(ctx context.Context, request shared.SourceT case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10808,7 +11492,10 @@ func (s *sources) CreateSourceTwilioTaskrouter(ctx context.Context, request shar return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10831,6 +11518,7 @@ func (s *sources) CreateSourceTwilioTaskrouter(ctx context.Context, request shar if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10847,7 +11535,7 @@ func (s *sources) CreateSourceTwilioTaskrouter(ctx context.Context, request shar case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10871,7 +11559,10 @@ func (s *sources) CreateSourceTwitter(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10894,6 +11585,7 @@ func (s *sources) CreateSourceTwitter(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10910,7 +11602,7 @@ func (s *sources) CreateSourceTwitter(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10934,7 +11626,10 @@ func (s *sources) CreateSourceTypeform(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -10957,6 +11652,7 @@ func (s *sources) CreateSourceTypeform(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -10973,7 +11669,7 @@ func (s *sources) CreateSourceTypeform(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -10997,7 +11693,10 @@ func (s *sources) CreateSourceUsCensus(ctx context.Context, request shared.Sourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11020,6 +11719,7 @@ func (s *sources) CreateSourceUsCensus(ctx context.Context, request shared.Sourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11036,7 +11736,7 @@ func (s *sources) CreateSourceUsCensus(ctx context.Context, request shared.Sourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11060,7 +11760,10 @@ func (s *sources) CreateSourceVantage(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11083,6 +11786,7 @@ func (s *sources) CreateSourceVantage(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11099,7 +11803,7 @@ func (s *sources) CreateSourceVantage(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11123,7 +11827,10 @@ func (s *sources) CreateSourceWebflow(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11146,6 +11853,7 @@ func (s *sources) CreateSourceWebflow(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11162,7 +11870,7 @@ func (s *sources) CreateSourceWebflow(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11186,7 +11894,10 @@ func (s *sources) CreateSourceWhiskyHunter(ctx context.Context, request shared.S return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11209,6 +11920,7 @@ func (s *sources) CreateSourceWhiskyHunter(ctx context.Context, request shared.S if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11225,7 +11937,7 @@ func (s *sources) CreateSourceWhiskyHunter(ctx context.Context, request shared.S case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11249,7 +11961,10 @@ func (s *sources) CreateSourceWikipediaPageviews(ctx context.Context, request sh return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11272,6 +11987,7 @@ func (s *sources) CreateSourceWikipediaPageviews(ctx context.Context, request sh if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11288,7 +12004,7 @@ func (s *sources) CreateSourceWikipediaPageviews(ctx context.Context, request sh case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11312,7 +12028,10 @@ func (s *sources) CreateSourceWoocommerce(ctx context.Context, request shared.So return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11335,6 +12054,7 @@ func (s *sources) CreateSourceWoocommerce(ctx context.Context, request shared.So if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11351,7 +12071,7 @@ func (s *sources) CreateSourceWoocommerce(ctx context.Context, request shared.So case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11375,7 +12095,10 @@ func (s *sources) CreateSourceXero(ctx context.Context, request shared.SourceXer return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11398,6 +12121,7 @@ func (s *sources) CreateSourceXero(ctx context.Context, request shared.SourceXer if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11414,7 +12138,7 @@ func (s *sources) CreateSourceXero(ctx context.Context, request shared.SourceXer case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11438,7 +12162,10 @@ func (s *sources) CreateSourceXkcd(ctx context.Context, request shared.SourceXkc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11461,6 +12188,7 @@ func (s *sources) CreateSourceXkcd(ctx context.Context, request shared.SourceXkc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11477,7 +12205,7 @@ func (s *sources) CreateSourceXkcd(ctx context.Context, request shared.SourceXkc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11501,7 +12229,10 @@ func (s *sources) CreateSourceYandexMetrica(ctx context.Context, request shared. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11524,6 +12255,7 @@ func (s *sources) CreateSourceYandexMetrica(ctx context.Context, request shared. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11540,7 +12272,7 @@ func (s *sources) CreateSourceYandexMetrica(ctx context.Context, request shared. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11564,7 +12296,10 @@ func (s *sources) CreateSourceYotpo(ctx context.Context, request shared.SourceYo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11587,6 +12322,7 @@ func (s *sources) CreateSourceYotpo(ctx context.Context, request shared.SourceYo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11603,7 +12339,7 @@ func (s *sources) CreateSourceYotpo(ctx context.Context, request shared.SourceYo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11627,7 +12363,10 @@ func (s *sources) CreateSourceYounium(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11650,6 +12389,7 @@ func (s *sources) CreateSourceYounium(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11666,7 +12406,7 @@ func (s *sources) CreateSourceYounium(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11690,7 +12430,10 @@ func (s *sources) CreateSourceYoutubeAnalytics(ctx context.Context, request shar return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11713,6 +12456,7 @@ func (s *sources) CreateSourceYoutubeAnalytics(ctx context.Context, request shar if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11729,7 +12473,7 @@ func (s *sources) CreateSourceYoutubeAnalytics(ctx context.Context, request shar case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11753,7 +12497,10 @@ func (s *sources) CreateSourceZendeskChat(ctx context.Context, request shared.So return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11776,6 +12523,7 @@ func (s *sources) CreateSourceZendeskChat(ctx context.Context, request shared.So if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11792,7 +12540,7 @@ func (s *sources) CreateSourceZendeskChat(ctx context.Context, request shared.So case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11816,7 +12564,10 @@ func (s *sources) CreateSourceZendeskSunshine(ctx context.Context, request share return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11839,6 +12590,7 @@ func (s *sources) CreateSourceZendeskSunshine(ctx context.Context, request share if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11855,7 +12607,7 @@ func (s *sources) CreateSourceZendeskSunshine(ctx context.Context, request share case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11879,7 +12631,10 @@ func (s *sources) CreateSourceZendeskSupport(ctx context.Context, request shared return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11902,6 +12657,7 @@ func (s *sources) CreateSourceZendeskSupport(ctx context.Context, request shared if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11918,7 +12674,7 @@ func (s *sources) CreateSourceZendeskSupport(ctx context.Context, request shared case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -11942,7 +12698,10 @@ func (s *sources) CreateSourceZendeskTalk(ctx context.Context, request shared.So return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -11965,6 +12724,7 @@ func (s *sources) CreateSourceZendeskTalk(ctx context.Context, request shared.So if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -11981,7 +12741,7 @@ func (s *sources) CreateSourceZendeskTalk(ctx context.Context, request shared.So case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -12005,7 +12765,10 @@ func (s *sources) CreateSourceZenloop(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -12028,6 +12791,7 @@ func (s *sources) CreateSourceZenloop(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -12044,7 +12808,7 @@ func (s *sources) CreateSourceZenloop(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -12068,7 +12832,10 @@ func (s *sources) CreateSourceZohoCrm(ctx context.Context, request shared.Source return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -12091,6 +12858,7 @@ func (s *sources) CreateSourceZohoCrm(ctx context.Context, request shared.Source if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -12107,7 +12875,7 @@ func (s *sources) CreateSourceZohoCrm(ctx context.Context, request shared.Source case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -12131,7 +12899,10 @@ func (s *sources) CreateSourceZoom(ctx context.Context, request shared.SourceZoo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -12154,6 +12925,7 @@ func (s *sources) CreateSourceZoom(ctx context.Context, request shared.SourceZoo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -12170,7 +12942,7 @@ func (s *sources) CreateSourceZoom(ctx context.Context, request shared.SourceZoo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -12194,7 +12966,10 @@ func (s *sources) CreateSourceZuora(ctx context.Context, request shared.SourceZu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -12217,6 +12992,7 @@ func (s *sources) CreateSourceZuora(ctx context.Context, request shared.SourceZu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -12233,7 +13009,7 @@ func (s *sources) CreateSourceZuora(ctx context.Context, request shared.SourceZu case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -21991,7 +22767,7 @@ func (s *sources) GetSource(ctx context.Context, request operations.GetSourceReq case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22049,7 +22825,7 @@ func (s *sources) GetSourceAircall(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22107,7 +22883,7 @@ func (s *sources) GetSourceAirtable(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22165,7 +22941,7 @@ func (s *sources) GetSourceAlloydb(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22223,7 +22999,7 @@ func (s *sources) GetSourceAmazonAds(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22281,7 +23057,7 @@ func (s *sources) GetSourceAmazonSqs(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22339,7 +23115,7 @@ func (s *sources) GetSourceAmplitude(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22397,7 +23173,7 @@ func (s *sources) GetSourceApifyDataset(ctx context.Context, request operations. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22455,7 +23231,7 @@ func (s *sources) GetSourceAsana(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22513,7 +23289,7 @@ func (s *sources) GetSourceAuth0(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22571,7 +23347,7 @@ func (s *sources) GetSourceAwsCloudtrail(ctx context.Context, request operations case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22629,7 +23405,7 @@ func (s *sources) GetSourceAzureBlobStorage(ctx context.Context, request operati case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22687,7 +23463,7 @@ func (s *sources) GetSourceAzureTable(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22745,7 +23521,7 @@ func (s *sources) GetSourceBambooHr(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22803,7 +23579,7 @@ func (s *sources) GetSourceBigcommerce(ctx context.Context, request operations.G case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22861,7 +23637,7 @@ func (s *sources) GetSourceBigquery(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22919,7 +23695,7 @@ func (s *sources) GetSourceBingAds(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -22977,7 +23753,7 @@ func (s *sources) GetSourceBraintree(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23035,7 +23811,7 @@ func (s *sources) GetSourceBraze(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23093,7 +23869,7 @@ func (s *sources) GetSourceChargebee(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23151,7 +23927,7 @@ func (s *sources) GetSourceChartmogul(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23209,7 +23985,7 @@ func (s *sources) GetSourceClickhouse(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23267,7 +24043,7 @@ func (s *sources) GetSourceClickupAPI(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23325,7 +24101,7 @@ func (s *sources) GetSourceCloseCom(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23383,7 +24159,7 @@ func (s *sources) GetSourceCoda(ctx context.Context, request operations.GetSourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23441,7 +24217,7 @@ func (s *sources) GetSourceCoinAPI(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23499,7 +24275,7 @@ func (s *sources) GetSourceCoinmarketcap(ctx context.Context, request operations case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23557,7 +24333,7 @@ func (s *sources) GetSourceConfigcat(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23615,7 +24391,7 @@ func (s *sources) GetSourceConfluence(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23673,7 +24449,7 @@ func (s *sources) GetSourceDatascope(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23731,7 +24507,7 @@ func (s *sources) GetSourceDelighted(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23789,7 +24565,7 @@ func (s *sources) GetSourceDixa(ctx context.Context, request operations.GetSourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23847,7 +24623,7 @@ func (s *sources) GetSourceDockerhub(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23905,7 +24681,7 @@ func (s *sources) GetSourceDremio(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -23963,7 +24739,7 @@ func (s *sources) GetSourceDynamodb(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24021,7 +24797,7 @@ func (s *sources) GetSourceE2eTestCloud(ctx context.Context, request operations. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24079,7 +24855,7 @@ func (s *sources) GetSourceEmailoctopus(ctx context.Context, request operations. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24137,7 +24913,7 @@ func (s *sources) GetSourceExchangeRates(ctx context.Context, request operations case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24195,7 +24971,7 @@ func (s *sources) GetSourceFacebookMarketing(ctx context.Context, request operat case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24253,7 +25029,7 @@ func (s *sources) GetSourceFacebookPages(ctx context.Context, request operations case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24311,7 +25087,7 @@ func (s *sources) GetSourceFaker(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24369,7 +25145,7 @@ func (s *sources) GetSourceFauna(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24427,7 +25203,7 @@ func (s *sources) GetSourceFileSecure(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24485,7 +25261,7 @@ func (s *sources) GetSourceFirebolt(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24543,7 +25319,7 @@ func (s *sources) GetSourceFreshcaller(ctx context.Context, request operations.G case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24601,7 +25377,7 @@ func (s *sources) GetSourceFreshdesk(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24659,7 +25435,7 @@ func (s *sources) GetSourceFreshsales(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24717,7 +25493,7 @@ func (s *sources) GetSourceFreshservice(ctx context.Context, request operations. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24775,7 +25551,7 @@ func (s *sources) GetSourceGcs(ctx context.Context, request operations.GetSource case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24833,7 +25609,7 @@ func (s *sources) GetSourceGetlago(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24891,7 +25667,7 @@ func (s *sources) GetSourceGithub(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -24949,7 +25725,7 @@ func (s *sources) GetSourceGitlab(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25007,7 +25783,7 @@ func (s *sources) GetSourceGlassfrog(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25065,7 +25841,7 @@ func (s *sources) GetSourceGnews(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25123,7 +25899,7 @@ func (s *sources) GetSourceGoogleAds(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25181,7 +25957,7 @@ func (s *sources) GetSourceGoogleAnalyticsDataAPI(ctx context.Context, request o case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25239,7 +26015,7 @@ func (s *sources) GetSourceGoogleAnalyticsV4(ctx context.Context, request operat case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25297,7 +26073,7 @@ func (s *sources) GetSourceGoogleDirectory(ctx context.Context, request operatio case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25355,7 +26131,7 @@ func (s *sources) GetSourceGooglePagespeedInsights(ctx context.Context, request case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25413,7 +26189,7 @@ func (s *sources) GetSourceGoogleSearchConsole(ctx context.Context, request oper case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25471,7 +26247,7 @@ func (s *sources) GetSourceGoogleSheets(ctx context.Context, request operations. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25529,7 +26305,7 @@ func (s *sources) GetSourceGoogleWebfonts(ctx context.Context, request operation case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25587,7 +26363,7 @@ func (s *sources) GetSourceGoogleWorkspaceAdminReports(ctx context.Context, requ case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25645,7 +26421,7 @@ func (s *sources) GetSourceGreenhouse(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25703,7 +26479,7 @@ func (s *sources) GetSourceGridly(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25761,7 +26537,7 @@ func (s *sources) GetSourceHarvest(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25819,7 +26595,7 @@ func (s *sources) GetSourceHubplanner(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25877,7 +26653,7 @@ func (s *sources) GetSourceHubspot(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25935,7 +26711,7 @@ func (s *sources) GetSourceInsightly(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -25993,7 +26769,7 @@ func (s *sources) GetSourceInstagram(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26051,7 +26827,7 @@ func (s *sources) GetSourceInstatus(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26109,7 +26885,7 @@ func (s *sources) GetSourceIntercom(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26167,7 +26943,7 @@ func (s *sources) GetSourceIp2whois(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26225,7 +27001,7 @@ func (s *sources) GetSourceIterable(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26283,7 +27059,7 @@ func (s *sources) GetSourceJira(ctx context.Context, request operations.GetSourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26341,7 +27117,7 @@ func (s *sources) GetSourceK6Cloud(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26399,7 +27175,7 @@ func (s *sources) GetSourceKlarna(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26457,7 +27233,7 @@ func (s *sources) GetSourceKlaviyo(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26515,7 +27291,7 @@ func (s *sources) GetSourceKustomerSinger(ctx context.Context, request operation case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26573,7 +27349,7 @@ func (s *sources) GetSourceLaunchdarkly(ctx context.Context, request operations. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26631,7 +27407,7 @@ func (s *sources) GetSourceLemlist(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26689,7 +27465,7 @@ func (s *sources) GetSourceLinkedinAds(ctx context.Context, request operations.G case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26747,7 +27523,7 @@ func (s *sources) GetSourceLinkedinPages(ctx context.Context, request operations case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26805,7 +27581,7 @@ func (s *sources) GetSourceLinnworks(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26863,7 +27639,7 @@ func (s *sources) GetSourceLokalise(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26921,7 +27697,7 @@ func (s *sources) GetSourceMailchimp(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -26979,7 +27755,7 @@ func (s *sources) GetSourceMailgun(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27037,7 +27813,7 @@ func (s *sources) GetSourceMailjetSms(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27095,7 +27871,7 @@ func (s *sources) GetSourceMarketo(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27153,7 +27929,7 @@ func (s *sources) GetSourceMetabase(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27211,7 +27987,7 @@ func (s *sources) GetSourceMicrosoftTeams(ctx context.Context, request operation case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27269,7 +28045,7 @@ func (s *sources) GetSourceMixpanel(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27327,7 +28103,7 @@ func (s *sources) GetSourceMonday(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27385,7 +28161,7 @@ func (s *sources) GetSourceMongodb(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27443,7 +28219,7 @@ func (s *sources) GetSourceMssql(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27501,7 +28277,7 @@ func (s *sources) GetSourceMyHours(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27559,7 +28335,7 @@ func (s *sources) GetSourceMysql(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27617,7 +28393,7 @@ func (s *sources) GetSourceNetsuite(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27675,7 +28451,7 @@ func (s *sources) GetSourceNotion(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27733,7 +28509,7 @@ func (s *sources) GetSourceNytimes(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27791,7 +28567,7 @@ func (s *sources) GetSourceOkta(ctx context.Context, request operations.GetSourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27849,7 +28625,7 @@ func (s *sources) GetSourceOmnisend(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27907,7 +28683,7 @@ func (s *sources) GetSourceOnesignal(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -27965,7 +28741,7 @@ func (s *sources) GetSourceOpenweather(ctx context.Context, request operations.G case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28023,7 +28799,7 @@ func (s *sources) GetSourceOracle(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28081,7 +28857,7 @@ func (s *sources) GetSourceOrb(ctx context.Context, request operations.GetSource case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28139,7 +28915,7 @@ func (s *sources) GetSourceOrbit(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28197,7 +28973,7 @@ func (s *sources) GetSourceOutreach(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28255,7 +29031,7 @@ func (s *sources) GetSourcePaypalTransaction(ctx context.Context, request operat case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28313,7 +29089,7 @@ func (s *sources) GetSourcePaystack(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28371,7 +29147,7 @@ func (s *sources) GetSourcePendo(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28429,7 +29205,7 @@ func (s *sources) GetSourcePersistiq(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28487,7 +29263,7 @@ func (s *sources) GetSourcePexelsAPI(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28545,7 +29321,7 @@ func (s *sources) GetSourcePinterest(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28603,7 +29379,7 @@ func (s *sources) GetSourcePipedrive(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28661,7 +29437,7 @@ func (s *sources) GetSourcePocket(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28719,7 +29495,7 @@ func (s *sources) GetSourcePokeapi(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28777,7 +29553,7 @@ func (s *sources) GetSourcePolygonStockAPI(ctx context.Context, request operatio case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28835,7 +29611,7 @@ func (s *sources) GetSourcePostgres(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28893,7 +29669,7 @@ func (s *sources) GetSourcePosthog(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -28951,7 +29727,7 @@ func (s *sources) GetSourcePostmarkapp(ctx context.Context, request operations.G case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29009,7 +29785,7 @@ func (s *sources) GetSourcePrestashop(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29067,7 +29843,7 @@ func (s *sources) GetSourcePublicApis(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29125,7 +29901,7 @@ func (s *sources) GetSourcePunkAPI(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29183,7 +29959,7 @@ func (s *sources) GetSourcePypi(ctx context.Context, request operations.GetSourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29241,7 +30017,7 @@ func (s *sources) GetSourceQualaroo(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29299,7 +30075,7 @@ func (s *sources) GetSourceQuickbooks(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29357,7 +30133,7 @@ func (s *sources) GetSourceRailz(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29415,7 +30191,7 @@ func (s *sources) GetSourceRecharge(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29473,7 +30249,7 @@ func (s *sources) GetSourceRecreation(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29531,7 +30307,7 @@ func (s *sources) GetSourceRecruitee(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29589,7 +30365,7 @@ func (s *sources) GetSourceRecurly(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29647,7 +30423,7 @@ func (s *sources) GetSourceRedshift(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29705,7 +30481,7 @@ func (s *sources) GetSourceRetently(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29763,7 +30539,7 @@ func (s *sources) GetSourceRkiCovid(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29821,7 +30597,7 @@ func (s *sources) GetSourceRss(ctx context.Context, request operations.GetSource case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29879,7 +30655,7 @@ func (s *sources) GetSourceS3(ctx context.Context, request operations.GetSourceS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29937,7 +30713,7 @@ func (s *sources) GetSourceSalesforce(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -29995,7 +30771,7 @@ func (s *sources) GetSourceSalesforceSinger(ctx context.Context, request operati case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30053,7 +30829,7 @@ func (s *sources) GetSourceSalesloft(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30111,7 +30887,7 @@ func (s *sources) GetSourceSapFieldglass(ctx context.Context, request operations case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30169,7 +30945,7 @@ func (s *sources) GetSourceSecoda(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30227,7 +31003,7 @@ func (s *sources) GetSourceSendgrid(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30285,7 +31061,7 @@ func (s *sources) GetSourceSendinblue(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30343,7 +31119,7 @@ func (s *sources) GetSourceSenseforce(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30401,7 +31177,7 @@ func (s *sources) GetSourceSentry(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30459,7 +31235,7 @@ func (s *sources) GetSourceSftp(ctx context.Context, request operations.GetSourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30517,7 +31293,7 @@ func (s *sources) GetSourceSftpBulk(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30575,7 +31351,7 @@ func (s *sources) GetSourceShopify(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30633,7 +31409,7 @@ func (s *sources) GetSourceShortio(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30691,7 +31467,7 @@ func (s *sources) GetSourceSlack(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30749,7 +31525,7 @@ func (s *sources) GetSourceSmaily(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30807,7 +31583,7 @@ func (s *sources) GetSourceSmartengage(ctx context.Context, request operations.G case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30865,7 +31641,7 @@ func (s *sources) GetSourceSmartsheets(ctx context.Context, request operations.G case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30923,7 +31699,7 @@ func (s *sources) GetSourceSnapchatMarketing(ctx context.Context, request operat case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -30981,7 +31757,7 @@ func (s *sources) GetSourceSnowflake(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31039,7 +31815,7 @@ func (s *sources) GetSourceSonarCloud(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31097,7 +31873,7 @@ func (s *sources) GetSourceSpacexAPI(ctx context.Context, request operations.Get case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31155,7 +31931,7 @@ func (s *sources) GetSourceSquare(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31213,7 +31989,7 @@ func (s *sources) GetSourceStrava(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31271,7 +32047,7 @@ func (s *sources) GetSourceStripe(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31329,7 +32105,7 @@ func (s *sources) GetSourceSurveySparrow(ctx context.Context, request operations case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31387,7 +32163,7 @@ func (s *sources) GetSourceSurveymonkey(ctx context.Context, request operations. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31445,7 +32221,7 @@ func (s *sources) GetSourceTempo(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31503,7 +32279,7 @@ func (s *sources) GetSourceTheGuardianAPI(ctx context.Context, request operation case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31561,7 +32337,7 @@ func (s *sources) GetSourceTiktokMarketing(ctx context.Context, request operatio case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31619,7 +32395,7 @@ func (s *sources) GetSourceTodoist(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31677,7 +32453,7 @@ func (s *sources) GetSourceTrello(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31735,7 +32511,7 @@ func (s *sources) GetSourceTrustpilot(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31793,7 +32569,7 @@ func (s *sources) GetSourceTvmazeSchedule(ctx context.Context, request operation case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31851,7 +32627,7 @@ func (s *sources) GetSourceTwilio(ctx context.Context, request operations.GetSou case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31909,7 +32685,7 @@ func (s *sources) GetSourceTwilioTaskrouter(ctx context.Context, request operati case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -31967,7 +32743,7 @@ func (s *sources) GetSourceTwitter(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32025,7 +32801,7 @@ func (s *sources) GetSourceTypeform(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32083,7 +32859,7 @@ func (s *sources) GetSourceUsCensus(ctx context.Context, request operations.GetS case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32141,7 +32917,7 @@ func (s *sources) GetSourceVantage(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32199,7 +32975,7 @@ func (s *sources) GetSourceWebflow(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32257,7 +33033,7 @@ func (s *sources) GetSourceWhiskyHunter(ctx context.Context, request operations. case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32315,7 +33091,7 @@ func (s *sources) GetSourceWikipediaPageviews(ctx context.Context, request opera case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32373,7 +33149,7 @@ func (s *sources) GetSourceWoocommerce(ctx context.Context, request operations.G case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32431,7 +33207,7 @@ func (s *sources) GetSourceXero(ctx context.Context, request operations.GetSourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32489,7 +33265,7 @@ func (s *sources) GetSourceXkcd(ctx context.Context, request operations.GetSourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32547,7 +33323,7 @@ func (s *sources) GetSourceYandexMetrica(ctx context.Context, request operations case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32605,7 +33381,7 @@ func (s *sources) GetSourceYotpo(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32663,7 +33439,7 @@ func (s *sources) GetSourceYounium(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32721,7 +33497,7 @@ func (s *sources) GetSourceYoutubeAnalytics(ctx context.Context, request operati case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32779,7 +33555,7 @@ func (s *sources) GetSourceZendeskChat(ctx context.Context, request operations.G case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32837,7 +33613,7 @@ func (s *sources) GetSourceZendeskSunshine(ctx context.Context, request operatio case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32895,7 +33671,7 @@ func (s *sources) GetSourceZendeskSupport(ctx context.Context, request operation case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -32953,7 +33729,7 @@ func (s *sources) GetSourceZendeskTalk(ctx context.Context, request operations.G case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -33011,7 +33787,7 @@ func (s *sources) GetSourceZenloop(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -33069,7 +33845,7 @@ func (s *sources) GetSourceZohoCrm(ctx context.Context, request operations.GetSo case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -33127,7 +33903,7 @@ func (s *sources) GetSourceZoom(ctx context.Context, request operations.GetSourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -33185,7 +33961,7 @@ func (s *sources) GetSourceZuora(ctx context.Context, request operations.GetSour case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -33216,7 +33992,10 @@ func (s *sources) InitiateOAuth(ctx context.Context, request shared.InitiateOaut return nil, fmt.Errorf("request body is required") } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -33239,6 +34018,7 @@ func (s *sources) InitiateOAuth(ctx context.Context, request shared.InitiateOaut if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -33306,7 +34086,7 @@ func (s *sources) ListSources(ctx context.Context, request operations.ListSource case utils.MatchContentType(contentType, `application/json`): var out *shared.SourcesResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourcesResponse = out @@ -33332,7 +34112,10 @@ func (s *sources) PatchSource(ctx context.Context, request operations.PatchSourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PATCH", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PATCH", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -33355,6 +34138,7 @@ func (s *sources) PatchSource(ctx context.Context, request operations.PatchSourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -33371,7 +34155,7 @@ func (s *sources) PatchSource(ctx context.Context, request operations.PatchSourc case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -33397,7 +34181,10 @@ func (s *sources) PutSource(ctx context.Context, request operations.PutSourceReq return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -33420,6 +34207,7 @@ func (s *sources) PutSource(ctx context.Context, request operations.PutSourceReq if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -33436,7 +34224,7 @@ func (s *sources) PutSource(ctx context.Context, request operations.PutSourceReq case utils.MatchContentType(contentType, `application/json`): var out *shared.SourceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.SourceResponse = out @@ -33462,7 +34250,10 @@ func (s *sources) PutSourceAircall(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -33485,6 +34276,7 @@ func (s *sources) PutSourceAircall(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -33519,7 +34311,10 @@ func (s *sources) PutSourceAirtable(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -33542,6 +34337,7 @@ func (s *sources) PutSourceAirtable(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -33576,7 +34372,10 @@ func (s *sources) PutSourceAlloydb(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -33599,6 +34398,7 @@ func (s *sources) PutSourceAlloydb(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -33633,7 +34433,10 @@ func (s *sources) PutSourceAmazonAds(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -33656,6 +34459,7 @@ func (s *sources) PutSourceAmazonAds(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -33690,7 +34494,10 @@ func (s *sources) PutSourceAmazonSqs(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -33713,6 +34520,7 @@ func (s *sources) PutSourceAmazonSqs(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -33747,7 +34555,10 @@ func (s *sources) PutSourceAmplitude(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -33770,6 +34581,7 @@ func (s *sources) PutSourceAmplitude(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -33804,7 +34616,10 @@ func (s *sources) PutSourceApifyDataset(ctx context.Context, request operations. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -33827,6 +34642,7 @@ func (s *sources) PutSourceApifyDataset(ctx context.Context, request operations. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -33861,7 +34677,10 @@ func (s *sources) PutSourceAsana(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -33884,6 +34703,7 @@ func (s *sources) PutSourceAsana(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -33918,7 +34738,10 @@ func (s *sources) PutSourceAuth0(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -33941,6 +34764,7 @@ func (s *sources) PutSourceAuth0(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -33975,7 +34799,10 @@ func (s *sources) PutSourceAwsCloudtrail(ctx context.Context, request operations return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -33998,6 +34825,7 @@ func (s *sources) PutSourceAwsCloudtrail(ctx context.Context, request operations if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34032,7 +34860,10 @@ func (s *sources) PutSourceAzureBlobStorage(ctx context.Context, request operati return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34055,6 +34886,7 @@ func (s *sources) PutSourceAzureBlobStorage(ctx context.Context, request operati if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34089,7 +34921,10 @@ func (s *sources) PutSourceAzureTable(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34112,6 +34947,7 @@ func (s *sources) PutSourceAzureTable(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34146,7 +34982,10 @@ func (s *sources) PutSourceBambooHr(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34169,6 +35008,7 @@ func (s *sources) PutSourceBambooHr(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34203,7 +35043,10 @@ func (s *sources) PutSourceBigcommerce(ctx context.Context, request operations.P return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34226,6 +35069,7 @@ func (s *sources) PutSourceBigcommerce(ctx context.Context, request operations.P if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34260,7 +35104,10 @@ func (s *sources) PutSourceBigquery(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34283,6 +35130,7 @@ func (s *sources) PutSourceBigquery(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34317,7 +35165,10 @@ func (s *sources) PutSourceBingAds(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34340,6 +35191,7 @@ func (s *sources) PutSourceBingAds(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34374,7 +35226,10 @@ func (s *sources) PutSourceBraintree(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34397,6 +35252,7 @@ func (s *sources) PutSourceBraintree(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34431,7 +35287,10 @@ func (s *sources) PutSourceBraze(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34454,6 +35313,7 @@ func (s *sources) PutSourceBraze(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34488,7 +35348,10 @@ func (s *sources) PutSourceChargebee(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34511,6 +35374,7 @@ func (s *sources) PutSourceChargebee(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34545,7 +35409,10 @@ func (s *sources) PutSourceChartmogul(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34568,6 +35435,7 @@ func (s *sources) PutSourceChartmogul(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34602,7 +35470,10 @@ func (s *sources) PutSourceClickhouse(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34625,6 +35496,7 @@ func (s *sources) PutSourceClickhouse(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34659,7 +35531,10 @@ func (s *sources) PutSourceClickupAPI(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34682,6 +35557,7 @@ func (s *sources) PutSourceClickupAPI(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34716,7 +35592,10 @@ func (s *sources) PutSourceCloseCom(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34739,6 +35618,7 @@ func (s *sources) PutSourceCloseCom(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34773,7 +35653,10 @@ func (s *sources) PutSourceCoda(ctx context.Context, request operations.PutSourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34796,6 +35679,7 @@ func (s *sources) PutSourceCoda(ctx context.Context, request operations.PutSourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34830,7 +35714,10 @@ func (s *sources) PutSourceCoinAPI(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34853,6 +35740,7 @@ func (s *sources) PutSourceCoinAPI(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34887,7 +35775,10 @@ func (s *sources) PutSourceCoinmarketcap(ctx context.Context, request operations return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34910,6 +35801,7 @@ func (s *sources) PutSourceCoinmarketcap(ctx context.Context, request operations if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -34944,7 +35836,10 @@ func (s *sources) PutSourceConfigcat(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -34967,6 +35862,7 @@ func (s *sources) PutSourceConfigcat(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35001,7 +35897,10 @@ func (s *sources) PutSourceConfluence(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35024,6 +35923,7 @@ func (s *sources) PutSourceConfluence(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35058,7 +35958,10 @@ func (s *sources) PutSourceDatascope(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35081,6 +35984,7 @@ func (s *sources) PutSourceDatascope(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35115,7 +36019,10 @@ func (s *sources) PutSourceDelighted(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35138,6 +36045,7 @@ func (s *sources) PutSourceDelighted(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35172,7 +36080,10 @@ func (s *sources) PutSourceDixa(ctx context.Context, request operations.PutSourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35195,6 +36106,7 @@ func (s *sources) PutSourceDixa(ctx context.Context, request operations.PutSourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35229,7 +36141,10 @@ func (s *sources) PutSourceDockerhub(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35252,6 +36167,7 @@ func (s *sources) PutSourceDockerhub(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35286,7 +36202,10 @@ func (s *sources) PutSourceDremio(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35309,6 +36228,7 @@ func (s *sources) PutSourceDremio(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35343,7 +36263,10 @@ func (s *sources) PutSourceDynamodb(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35366,6 +36289,7 @@ func (s *sources) PutSourceDynamodb(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35400,7 +36324,10 @@ func (s *sources) PutSourceE2eTestCloud(ctx context.Context, request operations. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35423,6 +36350,7 @@ func (s *sources) PutSourceE2eTestCloud(ctx context.Context, request operations. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35457,7 +36385,10 @@ func (s *sources) PutSourceEmailoctopus(ctx context.Context, request operations. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35480,6 +36411,7 @@ func (s *sources) PutSourceEmailoctopus(ctx context.Context, request operations. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35514,7 +36446,10 @@ func (s *sources) PutSourceExchangeRates(ctx context.Context, request operations return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35537,6 +36472,7 @@ func (s *sources) PutSourceExchangeRates(ctx context.Context, request operations if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35571,7 +36507,10 @@ func (s *sources) PutSourceFacebookMarketing(ctx context.Context, request operat return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35594,6 +36533,7 @@ func (s *sources) PutSourceFacebookMarketing(ctx context.Context, request operat if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35628,7 +36568,10 @@ func (s *sources) PutSourceFacebookPages(ctx context.Context, request operations return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35651,6 +36594,7 @@ func (s *sources) PutSourceFacebookPages(ctx context.Context, request operations if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35685,7 +36629,10 @@ func (s *sources) PutSourceFaker(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35708,6 +36655,7 @@ func (s *sources) PutSourceFaker(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35742,7 +36690,10 @@ func (s *sources) PutSourceFauna(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35765,6 +36716,7 @@ func (s *sources) PutSourceFauna(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35799,7 +36751,10 @@ func (s *sources) PutSourceFileSecure(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35822,6 +36777,7 @@ func (s *sources) PutSourceFileSecure(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35856,7 +36812,10 @@ func (s *sources) PutSourceFirebolt(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35879,6 +36838,7 @@ func (s *sources) PutSourceFirebolt(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35913,7 +36873,10 @@ func (s *sources) PutSourceFreshcaller(ctx context.Context, request operations.P return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35936,6 +36899,7 @@ func (s *sources) PutSourceFreshcaller(ctx context.Context, request operations.P if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -35970,7 +36934,10 @@ func (s *sources) PutSourceFreshdesk(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -35993,6 +36960,7 @@ func (s *sources) PutSourceFreshdesk(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36027,7 +36995,10 @@ func (s *sources) PutSourceFreshsales(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36050,6 +37021,7 @@ func (s *sources) PutSourceFreshsales(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36084,7 +37056,10 @@ func (s *sources) PutSourceFreshservice(ctx context.Context, request operations. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36107,6 +37082,7 @@ func (s *sources) PutSourceFreshservice(ctx context.Context, request operations. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36141,7 +37117,10 @@ func (s *sources) PutSourceGcs(ctx context.Context, request operations.PutSource return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36164,6 +37143,7 @@ func (s *sources) PutSourceGcs(ctx context.Context, request operations.PutSource if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36198,7 +37178,10 @@ func (s *sources) PutSourceGetlago(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36221,6 +37204,7 @@ func (s *sources) PutSourceGetlago(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36255,7 +37239,10 @@ func (s *sources) PutSourceGithub(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36278,6 +37265,7 @@ func (s *sources) PutSourceGithub(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36312,7 +37300,10 @@ func (s *sources) PutSourceGitlab(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36335,6 +37326,7 @@ func (s *sources) PutSourceGitlab(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36369,7 +37361,10 @@ func (s *sources) PutSourceGlassfrog(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36392,6 +37387,7 @@ func (s *sources) PutSourceGlassfrog(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36426,7 +37422,10 @@ func (s *sources) PutSourceGnews(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36449,6 +37448,7 @@ func (s *sources) PutSourceGnews(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36483,7 +37483,10 @@ func (s *sources) PutSourceGoogleAds(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36506,6 +37509,7 @@ func (s *sources) PutSourceGoogleAds(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36540,7 +37544,10 @@ func (s *sources) PutSourceGoogleAnalyticsDataAPI(ctx context.Context, request o return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36563,6 +37570,7 @@ func (s *sources) PutSourceGoogleAnalyticsDataAPI(ctx context.Context, request o if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36597,7 +37605,10 @@ func (s *sources) PutSourceGoogleAnalyticsV4(ctx context.Context, request operat return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36620,6 +37631,7 @@ func (s *sources) PutSourceGoogleAnalyticsV4(ctx context.Context, request operat if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36654,7 +37666,10 @@ func (s *sources) PutSourceGoogleDirectory(ctx context.Context, request operatio return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36677,6 +37692,7 @@ func (s *sources) PutSourceGoogleDirectory(ctx context.Context, request operatio if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36711,7 +37727,10 @@ func (s *sources) PutSourceGooglePagespeedInsights(ctx context.Context, request return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36734,6 +37753,7 @@ func (s *sources) PutSourceGooglePagespeedInsights(ctx context.Context, request if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36768,7 +37788,10 @@ func (s *sources) PutSourceGoogleSearchConsole(ctx context.Context, request oper return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36791,6 +37814,7 @@ func (s *sources) PutSourceGoogleSearchConsole(ctx context.Context, request oper if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36825,7 +37849,10 @@ func (s *sources) PutSourceGoogleSheets(ctx context.Context, request operations. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36848,6 +37875,7 @@ func (s *sources) PutSourceGoogleSheets(ctx context.Context, request operations. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36882,7 +37910,10 @@ func (s *sources) PutSourceGoogleWebfonts(ctx context.Context, request operation return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36905,6 +37936,7 @@ func (s *sources) PutSourceGoogleWebfonts(ctx context.Context, request operation if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36939,7 +37971,10 @@ func (s *sources) PutSourceGoogleWorkspaceAdminReports(ctx context.Context, requ return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -36962,6 +37997,7 @@ func (s *sources) PutSourceGoogleWorkspaceAdminReports(ctx context.Context, requ if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -36996,7 +38032,10 @@ func (s *sources) PutSourceGreenhouse(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37019,6 +38058,7 @@ func (s *sources) PutSourceGreenhouse(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37053,7 +38093,10 @@ func (s *sources) PutSourceGridly(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37076,6 +38119,7 @@ func (s *sources) PutSourceGridly(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37110,7 +38154,10 @@ func (s *sources) PutSourceHarvest(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37133,6 +38180,7 @@ func (s *sources) PutSourceHarvest(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37167,7 +38215,10 @@ func (s *sources) PutSourceHubplanner(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37190,6 +38241,7 @@ func (s *sources) PutSourceHubplanner(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37224,7 +38276,10 @@ func (s *sources) PutSourceHubspot(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37247,6 +38302,7 @@ func (s *sources) PutSourceHubspot(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37281,7 +38337,10 @@ func (s *sources) PutSourceInsightly(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37304,6 +38363,7 @@ func (s *sources) PutSourceInsightly(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37338,7 +38398,10 @@ func (s *sources) PutSourceInstagram(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37361,6 +38424,7 @@ func (s *sources) PutSourceInstagram(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37395,7 +38459,10 @@ func (s *sources) PutSourceInstatus(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37418,6 +38485,7 @@ func (s *sources) PutSourceInstatus(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37452,7 +38520,10 @@ func (s *sources) PutSourceIntercom(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37475,6 +38546,7 @@ func (s *sources) PutSourceIntercom(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37509,7 +38581,10 @@ func (s *sources) PutSourceIp2whois(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37532,6 +38607,7 @@ func (s *sources) PutSourceIp2whois(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37566,7 +38642,10 @@ func (s *sources) PutSourceIterable(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37589,6 +38668,7 @@ func (s *sources) PutSourceIterable(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37623,7 +38703,10 @@ func (s *sources) PutSourceJira(ctx context.Context, request operations.PutSourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37646,6 +38729,7 @@ func (s *sources) PutSourceJira(ctx context.Context, request operations.PutSourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37680,7 +38764,10 @@ func (s *sources) PutSourceK6Cloud(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37703,6 +38790,7 @@ func (s *sources) PutSourceK6Cloud(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37737,7 +38825,10 @@ func (s *sources) PutSourceKlarna(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37760,6 +38851,7 @@ func (s *sources) PutSourceKlarna(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37794,7 +38886,10 @@ func (s *sources) PutSourceKlaviyo(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37817,6 +38912,7 @@ func (s *sources) PutSourceKlaviyo(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37851,7 +38947,10 @@ func (s *sources) PutSourceKustomerSinger(ctx context.Context, request operation return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37874,6 +38973,7 @@ func (s *sources) PutSourceKustomerSinger(ctx context.Context, request operation if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37908,7 +39008,10 @@ func (s *sources) PutSourceLaunchdarkly(ctx context.Context, request operations. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37931,6 +39034,7 @@ func (s *sources) PutSourceLaunchdarkly(ctx context.Context, request operations. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -37965,7 +39069,10 @@ func (s *sources) PutSourceLemlist(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -37988,6 +39095,7 @@ func (s *sources) PutSourceLemlist(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38022,7 +39130,10 @@ func (s *sources) PutSourceLinkedinAds(ctx context.Context, request operations.P return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38045,6 +39156,7 @@ func (s *sources) PutSourceLinkedinAds(ctx context.Context, request operations.P if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38079,7 +39191,10 @@ func (s *sources) PutSourceLinkedinPages(ctx context.Context, request operations return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38102,6 +39217,7 @@ func (s *sources) PutSourceLinkedinPages(ctx context.Context, request operations if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38136,7 +39252,10 @@ func (s *sources) PutSourceLinnworks(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38159,6 +39278,7 @@ func (s *sources) PutSourceLinnworks(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38193,7 +39313,10 @@ func (s *sources) PutSourceLokalise(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38216,6 +39339,7 @@ func (s *sources) PutSourceLokalise(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38250,7 +39374,10 @@ func (s *sources) PutSourceMailchimp(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38273,6 +39400,7 @@ func (s *sources) PutSourceMailchimp(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38307,7 +39435,10 @@ func (s *sources) PutSourceMailgun(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38330,6 +39461,7 @@ func (s *sources) PutSourceMailgun(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38364,7 +39496,10 @@ func (s *sources) PutSourceMailjetSms(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38387,6 +39522,7 @@ func (s *sources) PutSourceMailjetSms(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38421,7 +39557,10 @@ func (s *sources) PutSourceMarketo(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38444,6 +39583,7 @@ func (s *sources) PutSourceMarketo(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38478,7 +39618,10 @@ func (s *sources) PutSourceMetabase(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38501,6 +39644,7 @@ func (s *sources) PutSourceMetabase(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38535,7 +39679,10 @@ func (s *sources) PutSourceMicrosoftTeams(ctx context.Context, request operation return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38558,6 +39705,7 @@ func (s *sources) PutSourceMicrosoftTeams(ctx context.Context, request operation if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38592,7 +39740,10 @@ func (s *sources) PutSourceMixpanel(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38615,6 +39766,7 @@ func (s *sources) PutSourceMixpanel(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38649,7 +39801,10 @@ func (s *sources) PutSourceMonday(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38672,6 +39827,7 @@ func (s *sources) PutSourceMonday(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38706,7 +39862,10 @@ func (s *sources) PutSourceMongodb(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38729,6 +39888,7 @@ func (s *sources) PutSourceMongodb(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38763,7 +39923,10 @@ func (s *sources) PutSourceMssql(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38786,6 +39949,7 @@ func (s *sources) PutSourceMssql(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38820,7 +39984,10 @@ func (s *sources) PutSourceMyHours(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38843,6 +40010,7 @@ func (s *sources) PutSourceMyHours(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38877,7 +40045,10 @@ func (s *sources) PutSourceMysql(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38900,6 +40071,7 @@ func (s *sources) PutSourceMysql(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38934,7 +40106,10 @@ func (s *sources) PutSourceNetsuite(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -38957,6 +40132,7 @@ func (s *sources) PutSourceNetsuite(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -38991,7 +40167,10 @@ func (s *sources) PutSourceNotion(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39014,6 +40193,7 @@ func (s *sources) PutSourceNotion(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39048,7 +40228,10 @@ func (s *sources) PutSourceNytimes(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39071,6 +40254,7 @@ func (s *sources) PutSourceNytimes(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39105,7 +40289,10 @@ func (s *sources) PutSourceOkta(ctx context.Context, request operations.PutSourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39128,6 +40315,7 @@ func (s *sources) PutSourceOkta(ctx context.Context, request operations.PutSourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39162,7 +40350,10 @@ func (s *sources) PutSourceOmnisend(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39185,6 +40376,7 @@ func (s *sources) PutSourceOmnisend(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39219,7 +40411,10 @@ func (s *sources) PutSourceOnesignal(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39242,6 +40437,7 @@ func (s *sources) PutSourceOnesignal(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39276,7 +40472,10 @@ func (s *sources) PutSourceOpenweather(ctx context.Context, request operations.P return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39299,6 +40498,7 @@ func (s *sources) PutSourceOpenweather(ctx context.Context, request operations.P if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39333,7 +40533,10 @@ func (s *sources) PutSourceOracle(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39356,6 +40559,7 @@ func (s *sources) PutSourceOracle(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39390,7 +40594,10 @@ func (s *sources) PutSourceOrb(ctx context.Context, request operations.PutSource return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39413,6 +40620,7 @@ func (s *sources) PutSourceOrb(ctx context.Context, request operations.PutSource if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39447,7 +40655,10 @@ func (s *sources) PutSourceOrbit(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39470,6 +40681,7 @@ func (s *sources) PutSourceOrbit(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39504,7 +40716,10 @@ func (s *sources) PutSourceOutreach(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39527,6 +40742,7 @@ func (s *sources) PutSourceOutreach(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39561,7 +40777,10 @@ func (s *sources) PutSourcePaypalTransaction(ctx context.Context, request operat return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39584,6 +40803,7 @@ func (s *sources) PutSourcePaypalTransaction(ctx context.Context, request operat if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39618,7 +40838,10 @@ func (s *sources) PutSourcePaystack(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39641,6 +40864,7 @@ func (s *sources) PutSourcePaystack(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39675,7 +40899,10 @@ func (s *sources) PutSourcePendo(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39698,6 +40925,7 @@ func (s *sources) PutSourcePendo(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39732,7 +40960,10 @@ func (s *sources) PutSourcePersistiq(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39755,6 +40986,7 @@ func (s *sources) PutSourcePersistiq(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39789,7 +41021,10 @@ func (s *sources) PutSourcePexelsAPI(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39812,6 +41047,7 @@ func (s *sources) PutSourcePexelsAPI(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39846,7 +41082,10 @@ func (s *sources) PutSourcePinterest(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39869,6 +41108,7 @@ func (s *sources) PutSourcePinterest(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39903,7 +41143,10 @@ func (s *sources) PutSourcePipedrive(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39926,6 +41169,7 @@ func (s *sources) PutSourcePipedrive(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -39960,7 +41204,10 @@ func (s *sources) PutSourcePocket(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -39983,6 +41230,7 @@ func (s *sources) PutSourcePocket(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40017,7 +41265,10 @@ func (s *sources) PutSourcePokeapi(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40040,6 +41291,7 @@ func (s *sources) PutSourcePokeapi(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40074,7 +41326,10 @@ func (s *sources) PutSourcePolygonStockAPI(ctx context.Context, request operatio return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40097,6 +41352,7 @@ func (s *sources) PutSourcePolygonStockAPI(ctx context.Context, request operatio if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40131,7 +41387,10 @@ func (s *sources) PutSourcePostgres(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40154,6 +41413,7 @@ func (s *sources) PutSourcePostgres(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40188,7 +41448,10 @@ func (s *sources) PutSourcePosthog(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40211,6 +41474,7 @@ func (s *sources) PutSourcePosthog(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40245,7 +41509,10 @@ func (s *sources) PutSourcePostmarkapp(ctx context.Context, request operations.P return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40268,6 +41535,7 @@ func (s *sources) PutSourcePostmarkapp(ctx context.Context, request operations.P if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40302,7 +41570,10 @@ func (s *sources) PutSourcePrestashop(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40325,6 +41596,7 @@ func (s *sources) PutSourcePrestashop(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40359,7 +41631,10 @@ func (s *sources) PutSourcePublicApis(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40382,6 +41657,7 @@ func (s *sources) PutSourcePublicApis(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40416,7 +41692,10 @@ func (s *sources) PutSourcePunkAPI(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40439,6 +41718,7 @@ func (s *sources) PutSourcePunkAPI(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40473,7 +41753,10 @@ func (s *sources) PutSourcePypi(ctx context.Context, request operations.PutSourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40496,6 +41779,7 @@ func (s *sources) PutSourcePypi(ctx context.Context, request operations.PutSourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40530,7 +41814,10 @@ func (s *sources) PutSourceQualaroo(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40553,6 +41840,7 @@ func (s *sources) PutSourceQualaroo(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40587,7 +41875,10 @@ func (s *sources) PutSourceQuickbooks(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40610,6 +41901,7 @@ func (s *sources) PutSourceQuickbooks(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40644,7 +41936,10 @@ func (s *sources) PutSourceRailz(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40667,6 +41962,7 @@ func (s *sources) PutSourceRailz(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40701,7 +41997,10 @@ func (s *sources) PutSourceRecharge(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40724,6 +42023,7 @@ func (s *sources) PutSourceRecharge(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40758,7 +42058,10 @@ func (s *sources) PutSourceRecreation(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40781,6 +42084,7 @@ func (s *sources) PutSourceRecreation(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40815,7 +42119,10 @@ func (s *sources) PutSourceRecruitee(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40838,6 +42145,7 @@ func (s *sources) PutSourceRecruitee(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40872,7 +42180,10 @@ func (s *sources) PutSourceRecurly(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40895,6 +42206,7 @@ func (s *sources) PutSourceRecurly(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40929,7 +42241,10 @@ func (s *sources) PutSourceRedshift(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -40952,6 +42267,7 @@ func (s *sources) PutSourceRedshift(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -40986,7 +42302,10 @@ func (s *sources) PutSourceRetently(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41009,6 +42328,7 @@ func (s *sources) PutSourceRetently(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41043,7 +42363,10 @@ func (s *sources) PutSourceRkiCovid(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41066,6 +42389,7 @@ func (s *sources) PutSourceRkiCovid(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41100,7 +42424,10 @@ func (s *sources) PutSourceRss(ctx context.Context, request operations.PutSource return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41123,6 +42450,7 @@ func (s *sources) PutSourceRss(ctx context.Context, request operations.PutSource if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41157,7 +42485,10 @@ func (s *sources) PutSourceS3(ctx context.Context, request operations.PutSourceS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41180,6 +42511,7 @@ func (s *sources) PutSourceS3(ctx context.Context, request operations.PutSourceS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41214,7 +42546,10 @@ func (s *sources) PutSourceSalesforce(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41237,6 +42572,7 @@ func (s *sources) PutSourceSalesforce(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41271,7 +42607,10 @@ func (s *sources) PutSourceSalesforceSinger(ctx context.Context, request operati return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41294,6 +42633,7 @@ func (s *sources) PutSourceSalesforceSinger(ctx context.Context, request operati if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41328,7 +42668,10 @@ func (s *sources) PutSourceSalesloft(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41351,6 +42694,7 @@ func (s *sources) PutSourceSalesloft(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41385,7 +42729,10 @@ func (s *sources) PutSourceSapFieldglass(ctx context.Context, request operations return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41408,6 +42755,7 @@ func (s *sources) PutSourceSapFieldglass(ctx context.Context, request operations if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41442,7 +42790,10 @@ func (s *sources) PutSourceSecoda(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41465,6 +42816,7 @@ func (s *sources) PutSourceSecoda(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41499,7 +42851,10 @@ func (s *sources) PutSourceSendgrid(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41522,6 +42877,7 @@ func (s *sources) PutSourceSendgrid(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41556,7 +42912,10 @@ func (s *sources) PutSourceSendinblue(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41579,6 +42938,7 @@ func (s *sources) PutSourceSendinblue(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41613,7 +42973,10 @@ func (s *sources) PutSourceSenseforce(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41636,6 +42999,7 @@ func (s *sources) PutSourceSenseforce(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41670,7 +43034,10 @@ func (s *sources) PutSourceSentry(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41693,6 +43060,7 @@ func (s *sources) PutSourceSentry(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41727,7 +43095,10 @@ func (s *sources) PutSourceSftp(ctx context.Context, request operations.PutSourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41750,6 +43121,7 @@ func (s *sources) PutSourceSftp(ctx context.Context, request operations.PutSourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41784,7 +43156,10 @@ func (s *sources) PutSourceSftpBulk(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41807,6 +43182,7 @@ func (s *sources) PutSourceSftpBulk(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41841,7 +43217,10 @@ func (s *sources) PutSourceShopify(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41864,6 +43243,7 @@ func (s *sources) PutSourceShopify(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41898,7 +43278,10 @@ func (s *sources) PutSourceShortio(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41921,6 +43304,7 @@ func (s *sources) PutSourceShortio(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -41955,7 +43339,10 @@ func (s *sources) PutSourceSlack(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -41978,6 +43365,7 @@ func (s *sources) PutSourceSlack(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42012,7 +43400,10 @@ func (s *sources) PutSourceSmaily(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42035,6 +43426,7 @@ func (s *sources) PutSourceSmaily(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42069,7 +43461,10 @@ func (s *sources) PutSourceSmartengage(ctx context.Context, request operations.P return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42092,6 +43487,7 @@ func (s *sources) PutSourceSmartengage(ctx context.Context, request operations.P if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42126,7 +43522,10 @@ func (s *sources) PutSourceSmartsheets(ctx context.Context, request operations.P return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42149,6 +43548,7 @@ func (s *sources) PutSourceSmartsheets(ctx context.Context, request operations.P if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42183,7 +43583,10 @@ func (s *sources) PutSourceSnapchatMarketing(ctx context.Context, request operat return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42206,6 +43609,7 @@ func (s *sources) PutSourceSnapchatMarketing(ctx context.Context, request operat if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42240,7 +43644,10 @@ func (s *sources) PutSourceSnowflake(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42263,6 +43670,7 @@ func (s *sources) PutSourceSnowflake(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42297,7 +43705,10 @@ func (s *sources) PutSourceSonarCloud(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42320,6 +43731,7 @@ func (s *sources) PutSourceSonarCloud(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42354,7 +43766,10 @@ func (s *sources) PutSourceSpacexAPI(ctx context.Context, request operations.Put return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42377,6 +43792,7 @@ func (s *sources) PutSourceSpacexAPI(ctx context.Context, request operations.Put if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42411,7 +43827,10 @@ func (s *sources) PutSourceSquare(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42434,6 +43853,7 @@ func (s *sources) PutSourceSquare(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42468,7 +43888,10 @@ func (s *sources) PutSourceStrava(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42491,6 +43914,7 @@ func (s *sources) PutSourceStrava(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42525,7 +43949,10 @@ func (s *sources) PutSourceStripe(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42548,6 +43975,7 @@ func (s *sources) PutSourceStripe(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42582,7 +44010,10 @@ func (s *sources) PutSourceSurveySparrow(ctx context.Context, request operations return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42605,6 +44036,7 @@ func (s *sources) PutSourceSurveySparrow(ctx context.Context, request operations if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42639,7 +44071,10 @@ func (s *sources) PutSourceSurveymonkey(ctx context.Context, request operations. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42662,6 +44097,7 @@ func (s *sources) PutSourceSurveymonkey(ctx context.Context, request operations. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42696,7 +44132,10 @@ func (s *sources) PutSourceTempo(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42719,6 +44158,7 @@ func (s *sources) PutSourceTempo(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42753,7 +44193,10 @@ func (s *sources) PutSourceTheGuardianAPI(ctx context.Context, request operation return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42776,6 +44219,7 @@ func (s *sources) PutSourceTheGuardianAPI(ctx context.Context, request operation if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42810,7 +44254,10 @@ func (s *sources) PutSourceTiktokMarketing(ctx context.Context, request operatio return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42833,6 +44280,7 @@ func (s *sources) PutSourceTiktokMarketing(ctx context.Context, request operatio if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42867,7 +44315,10 @@ func (s *sources) PutSourceTodoist(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42890,6 +44341,7 @@ func (s *sources) PutSourceTodoist(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42924,7 +44376,10 @@ func (s *sources) PutSourceTrello(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -42947,6 +44402,7 @@ func (s *sources) PutSourceTrello(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -42981,7 +44437,10 @@ func (s *sources) PutSourceTrustpilot(ctx context.Context, request operations.Pu return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43004,6 +44463,7 @@ func (s *sources) PutSourceTrustpilot(ctx context.Context, request operations.Pu if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43038,7 +44498,10 @@ func (s *sources) PutSourceTvmazeSchedule(ctx context.Context, request operation return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43061,6 +44524,7 @@ func (s *sources) PutSourceTvmazeSchedule(ctx context.Context, request operation if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43095,7 +44559,10 @@ func (s *sources) PutSourceTwilio(ctx context.Context, request operations.PutSou return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43118,6 +44585,7 @@ func (s *sources) PutSourceTwilio(ctx context.Context, request operations.PutSou if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43152,7 +44620,10 @@ func (s *sources) PutSourceTwilioTaskrouter(ctx context.Context, request operati return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43175,6 +44646,7 @@ func (s *sources) PutSourceTwilioTaskrouter(ctx context.Context, request operati if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43209,7 +44681,10 @@ func (s *sources) PutSourceTwitter(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43232,6 +44707,7 @@ func (s *sources) PutSourceTwitter(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43266,7 +44742,10 @@ func (s *sources) PutSourceTypeform(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43289,6 +44768,7 @@ func (s *sources) PutSourceTypeform(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43323,7 +44803,10 @@ func (s *sources) PutSourceUsCensus(ctx context.Context, request operations.PutS return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43346,6 +44829,7 @@ func (s *sources) PutSourceUsCensus(ctx context.Context, request operations.PutS if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43380,7 +44864,10 @@ func (s *sources) PutSourceVantage(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43403,6 +44890,7 @@ func (s *sources) PutSourceVantage(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43437,7 +44925,10 @@ func (s *sources) PutSourceWebflow(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43460,6 +44951,7 @@ func (s *sources) PutSourceWebflow(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43494,7 +44986,10 @@ func (s *sources) PutSourceWhiskyHunter(ctx context.Context, request operations. return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43517,6 +45012,7 @@ func (s *sources) PutSourceWhiskyHunter(ctx context.Context, request operations. if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43551,7 +45047,10 @@ func (s *sources) PutSourceWikipediaPageviews(ctx context.Context, request opera return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43574,6 +45073,7 @@ func (s *sources) PutSourceWikipediaPageviews(ctx context.Context, request opera if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43608,7 +45108,10 @@ func (s *sources) PutSourceWoocommerce(ctx context.Context, request operations.P return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43631,6 +45134,7 @@ func (s *sources) PutSourceWoocommerce(ctx context.Context, request operations.P if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43665,7 +45169,10 @@ func (s *sources) PutSourceXero(ctx context.Context, request operations.PutSourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43688,6 +45195,7 @@ func (s *sources) PutSourceXero(ctx context.Context, request operations.PutSourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43722,7 +45230,10 @@ func (s *sources) PutSourceXkcd(ctx context.Context, request operations.PutSourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43745,6 +45256,7 @@ func (s *sources) PutSourceXkcd(ctx context.Context, request operations.PutSourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43779,7 +45291,10 @@ func (s *sources) PutSourceYandexMetrica(ctx context.Context, request operations return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43802,6 +45317,7 @@ func (s *sources) PutSourceYandexMetrica(ctx context.Context, request operations if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43836,7 +45352,10 @@ func (s *sources) PutSourceYotpo(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43859,6 +45378,7 @@ func (s *sources) PutSourceYotpo(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43893,7 +45413,10 @@ func (s *sources) PutSourceYounium(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43916,6 +45439,7 @@ func (s *sources) PutSourceYounium(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -43950,7 +45474,10 @@ func (s *sources) PutSourceYoutubeAnalytics(ctx context.Context, request operati return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -43973,6 +45500,7 @@ func (s *sources) PutSourceYoutubeAnalytics(ctx context.Context, request operati if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -44007,7 +45535,10 @@ func (s *sources) PutSourceZendeskChat(ctx context.Context, request operations.P return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -44030,6 +45561,7 @@ func (s *sources) PutSourceZendeskChat(ctx context.Context, request operations.P if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -44064,7 +45596,10 @@ func (s *sources) PutSourceZendeskSunshine(ctx context.Context, request operatio return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -44087,6 +45622,7 @@ func (s *sources) PutSourceZendeskSunshine(ctx context.Context, request operatio if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -44121,7 +45657,10 @@ func (s *sources) PutSourceZendeskSupport(ctx context.Context, request operation return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -44144,6 +45683,7 @@ func (s *sources) PutSourceZendeskSupport(ctx context.Context, request operation if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -44178,7 +45718,10 @@ func (s *sources) PutSourceZendeskTalk(ctx context.Context, request operations.P return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -44201,6 +45744,7 @@ func (s *sources) PutSourceZendeskTalk(ctx context.Context, request operations.P if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -44235,7 +45779,10 @@ func (s *sources) PutSourceZenloop(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -44258,6 +45805,7 @@ func (s *sources) PutSourceZenloop(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -44292,7 +45840,10 @@ func (s *sources) PutSourceZohoCrm(ctx context.Context, request operations.PutSo return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -44315,6 +45866,7 @@ func (s *sources) PutSourceZohoCrm(ctx context.Context, request operations.PutSo if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -44349,7 +45901,10 @@ func (s *sources) PutSourceZoom(ctx context.Context, request operations.PutSourc return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -44372,6 +45927,7 @@ func (s *sources) PutSourceZoom(ctx context.Context, request operations.PutSourc if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -44406,7 +45962,10 @@ func (s *sources) PutSourceZuora(ctx context.Context, request operations.PutSour return nil, fmt.Errorf("error serializing request body: %w", err) } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -44429,6 +45988,7 @@ func (s *sources) PutSourceZuora(ctx context.Context, request operations.PutSour if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) diff --git a/internal/sdk/streams.go b/internal/sdk/streams.go index 71a314158..75725f0f9 100755 --- a/internal/sdk/streams.go +++ b/internal/sdk/streams.go @@ -70,7 +70,7 @@ func (s *streams) GetStreamProperties(ctx context.Context, request operations.Ge case utils.MatchContentType(contentType, `application/json`): var out *shared.StreamProperties if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.StreamProperties = out diff --git a/internal/sdk/workspaces.go b/internal/sdk/workspaces.go index 50fd73c18..cfbfda9fb 100755 --- a/internal/sdk/workspaces.go +++ b/internal/sdk/workspaces.go @@ -42,7 +42,10 @@ func (s *workspaces) CreateOrUpdateWorkspaceOAuthCredentials(ctx context.Context return nil, fmt.Errorf("request body is required") } - req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PUT", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -65,6 +68,7 @@ func (s *workspaces) CreateOrUpdateWorkspaceOAuthCredentials(ctx context.Context if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -99,7 +103,10 @@ func (s *workspaces) CreateWorkspace(ctx context.Context, request shared.Workspa return nil, fmt.Errorf("request body is required") } - req, err := http.NewRequestWithContext(ctx, "POST", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "POST", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -122,6 +129,7 @@ func (s *workspaces) CreateWorkspace(ctx context.Context, request shared.Workspa if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -138,7 +146,7 @@ func (s *workspaces) CreateWorkspace(ctx context.Context, request shared.Workspa case utils.MatchContentType(contentType, `application/json`): var out *shared.WorkspaceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.WorkspaceResponse = out @@ -246,7 +254,7 @@ func (s *workspaces) GetWorkspace(ctx context.Context, request operations.GetWor case utils.MatchContentType(contentType, `application/json`): var out *shared.WorkspaceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.WorkspaceResponse = out @@ -305,7 +313,7 @@ func (s *workspaces) ListWorkspaces(ctx context.Context, request operations.List case utils.MatchContentType(contentType, `application/json`): var out *shared.WorkspacesResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.WorkspacesResponse = out @@ -334,7 +342,10 @@ func (s *workspaces) UpdateWorkspace(ctx context.Context, request operations.Upd return nil, fmt.Errorf("request body is required") } - req, err := http.NewRequestWithContext(ctx, "PATCH", url, bodyReader) + debugBody := bytes.NewBuffer([]byte{}) + debugReader := io.TeeReader(bodyReader, debugBody) + + req, err := http.NewRequestWithContext(ctx, "PATCH", url, debugReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -357,6 +368,7 @@ func (s *workspaces) UpdateWorkspace(ctx context.Context, request operations.Upd if err != nil { return nil, fmt.Errorf("error reading response body: %w", err) } + httpRes.Request.Body = io.NopCloser(debugBody) httpRes.Body.Close() httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) @@ -373,7 +385,7 @@ func (s *workspaces) UpdateWorkspace(ctx context.Context, request operations.Upd case utils.MatchContentType(contentType, `application/json`): var out *shared.WorkspaceResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { - return nil, err + return res, err } res.WorkspaceResponse = out