Skip to content

Commit

Permalink
teams e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
triedandtested-dev committed Mar 12, 2024
1 parent dc82c5d commit bf25671
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
20 changes: 17 additions & 3 deletions internal/provider/datasources/team.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ type TeamDataSource struct {
}

type TeamDataSourceModel struct {
ID customtypes.UUIDValue `tfsdk:"id"`
Name types.String `tfsdk:"first_name"`
Description types.String `tfsdk:"last_name"`
ID customtypes.UUIDValue `tfsdk:"id"`
Created customtypes.TimestampValue `tfsdk:"created"`
Updated customtypes.TimestampValue `tfsdk:"updated"`
Name types.String `tfsdk:"first_name"`
Description types.String `tfsdk:"last_name"`

AccountID customtypes.UUIDValue `tfsdk:"account_id"`
}
Expand All @@ -49,6 +51,16 @@ var teamAttributesBase = map[string]schema.Attribute{
CustomType: customtypes.UUIDType{},
Description: "Team ID (UUID)",
},
"created": schema.StringAttribute{
Computed: true,
CustomType: customtypes.TimestampType{},
Description: "Date and time of the team creation in RFC 3339 format",
},
"updated": schema.StringAttribute{
Computed: true,
CustomType: customtypes.TimestampType{},
Description: "Date and time that the team was last updated in RFC 3339 format",
},
"name": schema.StringAttribute{
Computed: true,
Description: "Name of Team",
Expand Down Expand Up @@ -145,6 +157,8 @@ func (d *TeamDataSource) Read(ctx context.Context, req datasource.ReadRequest, r
fetchedTeam := teams[0]

config.ID = customtypes.NewUUIDValue(fetchedTeam.ID)
config.Created = customtypes.NewTimestampPointerValue(fetchedTeam.Created)
config.Updated = customtypes.NewTimestampPointerValue(fetchedTeam.Updated)
config.Name = types.StringValue(fetchedTeam.Name)
config.Description = types.StringValue(fetchedTeam.Description)

Expand Down
2 changes: 2 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ func (p *PrefectProvider) DataSources(_ context.Context) []func() datasource.Dat
datasources.NewAccountMemberDataSource,
datasources.NewAccountRoleDataSource,
datasources.NewServiceAccountDataSource,
datasources.NewTeamDataSource,
datasources.NewTeamsDataSource,
datasources.NewVariableDataSource,
datasources.NewWorkerMetadataDataSource,
datasources.NewWorkPoolDataSource,
Expand Down

0 comments on commit bf25671

Please sign in to comment.