@@ -28,6 +28,31 @@ func resourceGithubCopilotOrganizationSeatAssignment() *schema.Resource {
2828 DiffSuppressFunc : caseInsensitive (),
2929 Description : "The login of the user to assign a Copilot seat." ,
3030 },
31+ "created_at" : {
32+ Type : schema .TypeString ,
33+ Computed : true ,
34+ Description : "Timestamp of when the seat was first assigned." ,
35+ },
36+ "pending_cancellation_date" : {
37+ Type : schema .TypeString ,
38+ Computed : true ,
39+ Description : "Date on which the seat will be cancelled, if pending cancellation." ,
40+ },
41+ "last_activity_at" : {
42+ Type : schema .TypeString ,
43+ Computed : true ,
44+ Description : "Timestamp of the user's last Copilot activity." ,
45+ },
46+ "last_activity_editor" : {
47+ Type : schema .TypeString ,
48+ Computed : true ,
49+ Description : "Editor used in the user's last Copilot activity." ,
50+ },
51+ "plan_type" : {
52+ Type : schema .TypeString ,
53+ Computed : true ,
54+ Description : "The Copilot plan type for this seat (e.g. business, enterprise)." ,
55+ },
3156 },
3257 }
3358}
@@ -56,7 +81,7 @@ func resourceGithubCopilotOrganizationSeatAssignmentRead(ctx context.Context, d
5681
5782 username := d .Id ()
5883
59- _ , _ , err := client .Copilot .GetSeatDetails (ctx , org , username )
84+ seat , _ , err := client .Copilot .GetSeatDetails (ctx , org , username )
6085 if err != nil {
6186 if ghErr , ok := errors.AsType [* github.ErrorResponse ](err ); ok && ghErr .Response .StatusCode == http .StatusNotFound {
6287 tflog .Info (ctx , "Copilot seat assignment no longer exists, removing from state" , map [string ]any {"username" : username })
@@ -70,6 +95,26 @@ func resourceGithubCopilotOrganizationSeatAssignmentRead(ctx context.Context, d
7095 return diag .FromErr (err )
7196 }
7297
98+ createdAt := seat .GetCreatedAt ()
99+ if err := d .Set ("created_at" , createdAt .String ()); err != nil {
100+ return diag .FromErr (err )
101+ }
102+ if err := d .Set ("pending_cancellation_date" , seat .GetPendingCancellationDate ()); err != nil {
103+ return diag .FromErr (err )
104+ }
105+ if err := d .Set ("last_activity_editor" , seat .GetLastActivityEditor ()); err != nil {
106+ return diag .FromErr (err )
107+ }
108+ if err := d .Set ("plan_type" , seat .GetPlanType ()); err != nil {
109+ return diag .FromErr (err )
110+ }
111+
112+ if lastActivity := seat .GetLastActivityAt (); ! lastActivity .IsZero () {
113+ if err := d .Set ("last_activity_at" , lastActivity .String ()); err != nil {
114+ return diag .FromErr (err )
115+ }
116+ }
117+
73118 return nil
74119}
75120
0 commit comments