1+ // Package stream for Fabric Stream resource and data sources
12package stream
23
34import (
@@ -14,18 +15,21 @@ import (
1415 "github.com/hashicorp/terraform-plugin-framework/types/basetypes"
1516)
1617
18+ // DataSourceByIDModel stream datasource model
1719type DataSourceByIDModel struct {
1820 StreamID types.String `tfsdk:"stream_id"`
1921 ID types.String `tfsdk:"id"`
2022 BaseStreamModel
2123}
2224
25+ // DataSourceAllStreamsModel streams datasource model
2326type DataSourceAllStreamsModel struct {
2427 ID types.String `tfsdk:"id"`
2528 Pagination fwtypes.ObjectValueOf [PaginationModel ] `tfsdk:"pagination"`
2629 Data fwtypes.ListNestedObjectValueOf [BaseStreamModel ] `tfsdk:"data"`
2730}
2831
32+ // PaginationModel stream pagination model
2933type PaginationModel struct {
3034 Offset types.Int32 `tfsdk:"offset"`
3135 Limit types.Int32 `tfsdk:"limit"`
@@ -34,12 +38,14 @@ type PaginationModel struct {
3438 Previous types.String `tfsdk:"previous"`
3539}
3640
41+ // ResourceModel stream resource model
3742type ResourceModel struct {
3843 ID types.String `tfsdk:"id"`
3944 Timeouts timeouts.Value `tfsdk:"timeouts"`
4045 BaseStreamModel
4146}
4247
48+ // BaseStreamModel stream base model
4349type BaseStreamModel struct {
4450 Type types.String `tfsdk:"type"`
4551 Name types.String `tfsdk:"name"`
@@ -53,10 +59,12 @@ type BaseStreamModel struct {
5359 ChangeLog fwtypes.ObjectValueOf [ChangeLogModel ] `tfsdk:"change_log"` // Object of ChangeLogModel
5460}
5561
62+ // ProjectModel stream project model
5663type ProjectModel struct {
5764 ProjectID types.String `tfsdk:"project_id"`
5865}
5966
67+ // ChangeLogModel stream changeLog model
6068type ChangeLogModel struct {
6169 CreatedBy types.String `tfsdk:"created_by"`
6270 CreatedByFullName types.String `tfsdk:"created_by_full_name"`
@@ -183,7 +191,7 @@ func parseStream(ctx context.Context, stream *fabricv4.Stream,
183191 * description = types .StringValue (stream .GetDescription ())
184192 * href = types .StringValue (stream .GetHref ())
185193 * uuid = types .StringValue (stream .GetUuid ())
186- * state = types .StringValue (stream .GetState ())
194+ * state = types .StringValue (string ( stream .GetState () ))
187195 * assetsCount = types .Int32Value (stream .GetAssetsCount ())
188196 * streamSubscriptionCount = types .Int32Value (stream .GetStreamSubscriptionsCount ())
189197
0 commit comments