Skip to content

Commit

Permalink
remove totalCount
Browse files Browse the repository at this point in the history
  • Loading branch information
maastha committed Aug 19, 2024
1 parent 40ec9d1 commit 4e1b5f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/stretchr/testify/assert"

"github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion"
"github.com/mongodb/terraform-provider-mongodbatlas/internal/service/encryptionatrestprivateendpoint"
)

Expand Down Expand Up @@ -156,7 +155,6 @@ func TestEncryptionAtRestPrivateEndpointPluralDSSDKToTFModel(t *testing.T) {
expectedTFModel: &encryptionatrestprivateendpoint.TFEncryptionAtRestPrivateEndpointsDSModel{
CloudProvider: types.StringValue(testCloudProvider),
ProjectID: types.StringValue(testProjectID),
TotalCount: types.Int64Value(int64(testTotalResultCount)),
Results: []encryptionatrestprivateendpoint.TFEarPrivateEndpointDSModel{
{
CloudProvider: types.StringValue(testCloudProvider),
Expand All @@ -181,7 +179,7 @@ func TestEncryptionAtRestPrivateEndpointPluralDSSDKToTFModel(t *testing.T) {

for testName, tc := range testCases {
t.Run(testName, func(t *testing.T) {
resultModel := encryptionatrestprivateendpoint.NewTFEarPrivateEndpoints(testProjectID, testCloudProvider, conversion.IntPtr(testTotalResultCount), tc.SDKResp)
resultModel := encryptionatrestprivateendpoint.NewTFEarPrivateEndpoints(testProjectID, testCloudProvider, tc.SDKResp)
assert.Equal(t, tc.expectedTFModel, resultModel, "created terraform model did not match expected output")
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ func PluralDataSourceSchema(ctx context.Context) schema.Schema {
Description: "List of returned documents that MongoDB Cloud providers when completing this request.",
MarkdownDescription: "List of returned documents that MongoDB Cloud providers when completing this request.",
},
"total_count": schema.Int64Attribute{
Computed: true,
Description: "Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`.",
MarkdownDescription: "Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`.",
},
},
}
}
Expand All @@ -76,7 +71,6 @@ type TFEncryptionAtRestPrivateEndpointsDSModel struct {
CloudProvider types.String `tfsdk:"cloud_provider"`
ProjectID types.String `tfsdk:"project_id"`
Results []TFEarPrivateEndpointDSModel `tfsdk:"results"`
TotalCount types.Int64 `tfsdk:"total_count"`
}

type TFEarPrivateEndpointDSModel struct {
Expand All @@ -88,10 +82,9 @@ type TFEarPrivateEndpointDSModel struct {
Status types.String `tfsdk:"status"`
}

func NewTFEarPrivateEndpoints(projectID, cloudProvider string, totalCount *int, results []admin.EARPrivateEndpoint) *TFEncryptionAtRestPrivateEndpointsDSModel {
func NewTFEarPrivateEndpoints(projectID, cloudProvider string, results []admin.EARPrivateEndpoint) *TFEncryptionAtRestPrivateEndpointsDSModel {
return &TFEncryptionAtRestPrivateEndpointsDSModel{
ProjectID: types.StringValue(projectID),
TotalCount: types.Int64PointerValue(conversion.IntPtrToInt64Ptr(totalCount)),
CloudProvider: types.StringValue(cloudProvider),
Results: NewTFEarPrivateEndpointsDS(results),
}
Expand Down

0 comments on commit 4e1b5f4

Please sign in to comment.