Skip to content

Commit

Permalink
Fix schema elements and data models
Browse files Browse the repository at this point in the history
  • Loading branch information
thogarty committed Feb 25, 2025
1 parent 355ccd7 commit 44c4ad0
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ func (r *DataSourceAllStreams) Read(ctx context.Context, request datasource.Read
client := r.Meta.NewFabricClientForFramework(ctx, request.ProviderMeta)

// Retrieve values from plan
var data DataSourceAll
var data dataSourceAll
response.Diagnostics.Append(request.Config.Get(ctx, &data)...)
if response.Diagnostics.HasError() {
return
}

var pagination PaginationModel
var pagination paginationModel
diags := data.Pagination.As(ctx, &pagination, basetypes.ObjectAsOptions{})
if diags.HasError() {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (r *DataSourceByStreamID) Read(ctx context.Context, request datasource.Read
client := r.Meta.NewFabricClientForFramework(ctx, request.ProviderMeta)

// Retrieve values from plan
var data DataSourceByIDsModel
var data dataSourceByIDsModel
response.Diagnostics.Append(request.Config.Get(ctx, &data)...)
if response.Diagnostics.HasError() {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Additional Documentation:
"pagination": schema.SingleNestedAttribute{
Description: "Pagination details for the returned streams list",
Required: true,
CustomType: fwtypes.NewObjectTypeOf[PaginationModel](ctx),
CustomType: fwtypes.NewObjectTypeOf[paginationModel](ctx),
Attributes: map[string]schema.Attribute{
"offset": schema.Int32Attribute{
Description: "Index of the first item returned in the response. The default is 0",
Expand Down Expand Up @@ -55,7 +55,7 @@ Additional Documentation:
"data": schema.ListNestedAttribute{
Description: "Returned list of stream objects",
Computed: true,
CustomType: fwtypes.NewListNestedObjectTypeOf[BaseStreamSubscriptionModel](ctx),
CustomType: fwtypes.NewListNestedObjectTypeOf[baseStreamSubscriptionModel](ctx),
NestedObject: schema.NestedAttributeObject{
Attributes: getStreamSubscriptionSchema(ctx),
},
Expand Down Expand Up @@ -107,7 +107,7 @@ func getStreamSubscriptionSchema(ctx context.Context) map[string]schema.Attribut
"filters": schema.ListNestedAttribute{
Description: "List of filters to apply to the stream subscription selectors. Maximum of 8. All will be AND'd together with 1 of the 8 being a possible OR group of 3",
Computed: true,
CustomType: fwtypes.NewListNestedObjectTypeOf[FilterModel](ctx),
CustomType: fwtypes.NewListNestedObjectTypeOf[filterModel](ctx),
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"property": schema.StringAttribute{
Expand All @@ -133,7 +133,7 @@ func getStreamSubscriptionSchema(ctx context.Context) map[string]schema.Attribut
"metric_selector": schema.SingleNestedAttribute{
Description: "Lists of metrics to be included/excluded on the stream subscription",
Computed: true,
CustomType: fwtypes.NewObjectTypeOf[SelectorModel](ctx),
CustomType: fwtypes.NewObjectTypeOf[selectorModel](ctx),
Attributes: map[string]schema.Attribute{
"include": schema.ListAttribute{
Description: "List of metrics to include",
Expand All @@ -150,7 +150,7 @@ func getStreamSubscriptionSchema(ctx context.Context) map[string]schema.Attribut
"event_selector": schema.SingleNestedAttribute{
Description: "Lists of events to be included/excluded on the stream subscription",
Computed: true,
CustomType: fwtypes.NewObjectTypeOf[SelectorModel](ctx),
CustomType: fwtypes.NewObjectTypeOf[selectorModel](ctx),
Attributes: map[string]schema.Attribute{
"include": schema.ListAttribute{
Description: "List of events to include",
Expand All @@ -167,7 +167,7 @@ func getStreamSubscriptionSchema(ctx context.Context) map[string]schema.Attribut
"sink": schema.SingleNestedAttribute{
Description: "The details of the subscriber to the Equinix Stream",
Computed: true,
CustomType: fwtypes.NewObjectTypeOf[SinkModel](ctx),
CustomType: fwtypes.NewObjectTypeOf[sinkModel](ctx),
Attributes: map[string]schema.Attribute{
"uri": schema.StringAttribute{
Description: "Publicly reachable http endpoint destination for data stream",
Expand Down Expand Up @@ -196,7 +196,7 @@ func getStreamSubscriptionSchema(ctx context.Context) map[string]schema.Attribut
"credential": schema.SingleNestedAttribute{
Description: "Access details for the specified sink type",
Computed: true,
CustomType: fwtypes.NewObjectTypeOf[SinkCredentialModel](ctx),
CustomType: fwtypes.NewObjectTypeOf[sinkCredentialModel](ctx),
Attributes: map[string]schema.Attribute{
"type": schema.StringAttribute{
Description: "Type of the credential being passed",
Expand Down Expand Up @@ -227,7 +227,7 @@ func getStreamSubscriptionSchema(ctx context.Context) map[string]schema.Attribut
"settings": schema.SingleNestedAttribute{
Description: "Stream subscription sink settings",
Computed: true,
CustomType: fwtypes.NewObjectTypeOf[SinkCredentialModel](ctx),
CustomType: fwtypes.NewObjectTypeOf[sinkCredentialModel](ctx),
Attributes: map[string]schema.Attribute{
"event_index": schema.StringAttribute{
Computed: true,
Expand All @@ -247,9 +247,6 @@ func getStreamSubscriptionSchema(ctx context.Context) map[string]schema.Attribut
"metric_uri": schema.StringAttribute{
Computed: true,
},
"transform_alerts": schema.BoolAttribute{
Computed: true,
},
},
},
},
Expand All @@ -269,7 +266,7 @@ func getStreamSubscriptionSchema(ctx context.Context) map[string]schema.Attribut
"change_log": schema.SingleNestedAttribute{
Description: "Details of the last change on the stream resource",
Computed: true,
CustomType: fwtypes.NewObjectTypeOf[ChangeLogModel](ctx),
CustomType: fwtypes.NewObjectTypeOf[changeLogModel](ctx),
Attributes: map[string]schema.Attribute{
"created_by": schema.StringAttribute{
Description: "User name of creator of the stream resource",
Expand Down
Loading

0 comments on commit 44c4ad0

Please sign in to comment.