Skip to content

Commit ce1fab9

Browse files
authored
feat(datasource/sentry_organization_member): Add internal_id attribute (#723)
1 parent d2cad79 commit ce1fab9

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

docs/data-sources/organization_member.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ data "sentry_organization_member" "default" {
3030
### Read-Only
3131

3232
- `id` (String) The ID of this resource.
33+
- `internal_id` (String) The internal ID of the organization member.
3334
- `role` (String) This is the role of the organization member.

internal/apiclient/api.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,7 @@ components:
973973
- pending
974974
- expired
975975
- orgRole
976+
- user
976977
properties:
977978
id:
978979
type: string
@@ -986,6 +987,13 @@ components:
986987
type: boolean
987988
orgRole:
988989
type: string
990+
user:
991+
type: object
992+
required:
993+
- id
994+
properties:
995+
id:
996+
type: string
989997
OrganizationRoleListItem:
990998
type: object
991999
required:

internal/apiclient/apiclient.gen.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/provider/data_source_organization_member.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ import (
1515

1616
type OrganizationMemberDataSourceModel struct {
1717
Id types.String `tfsdk:"id"`
18+
InternalId types.String `tfsdk:"internal_id"`
1819
Organization types.String `tfsdk:"organization"`
1920
Email types.String `tfsdk:"email"`
2021
Role types.String `tfsdk:"role"`
2122
}
2223

2324
func (m *OrganizationMemberDataSourceModel) Fill(ctx context.Context, member apiclient.OrganizationMember) (diags diag.Diagnostics) {
2425
m.Id = types.StringValue(member.Id)
26+
m.InternalId = types.StringValue(member.User.Id)
2527
m.Email = types.StringValue(member.Email)
2628
m.Role = types.StringValue(member.OrgRole)
2729
return
@@ -51,6 +53,10 @@ func (d *OrganizationMemberDataSource) Schema(ctx context.Context, req datasourc
5153
MarkdownDescription: "The ID of this resource.",
5254
Computed: true,
5355
},
56+
"internal_id": schema.StringAttribute{
57+
MarkdownDescription: "The internal ID of the organization member.",
58+
Computed: true,
59+
},
5460
"organization": DataSourceOrganizationAttribute(),
5561
"email": schema.StringAttribute{
5662
MarkdownDescription: "The email of the organization member.",

0 commit comments

Comments
 (0)