feat(generated): OrganizationMembership (batch e471ddef)#113
feat(generated): OrganizationMembership (batch e471ddef)#113workos-sdk-automation[bot] wants to merge 2 commits into
Conversation
Greptile SummaryThis PR regenerates the Rust SDK from an updated spec. The main changes are:
Confidence Score: 2/5Not safe to merge. The crate can fail to compile from missing generated modules and a removed organization-domain export.
src/models/mod.rs, src/enums/mod.rs, src/models/organization_membership.rs, src/models/user_organization_membership.rs Important Files Changed
Prompt To Fix All With AIFix the following 5 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 5
src/models/mod.rs:43
**Missing Generated Model Files**
This `mod` declaration requires a matching Rust source file, but the generated model file is not present. The same missing-file pattern applies to the newly declared pipes and session reauthentication model modules in this file, so the crate can fail to compile with `file not found for module` before SDK consumers can use it.
### Issue 2 of 5
src/enums/mod.rs:98-99
**Missing Generated Enum Files**
These new enum module declarations require matching files under `src/enums/`, but the generated enum files are not present. Building the crate can fail immediately with `file not found for module` for the session reauthentication auth method and status enums.
### Issue 3 of 5
src/models/mod.rs:338
**Removed Export Still Returned**
Removing `organization_domain_stand_alone` from the model module tree leaves the organization domain resource methods returning a type that is no longer exported through `crate::models::*`. Calls like `get_organization_domain` and `verify_organization_domain` still return `OrganizationDomainStandAlone`, so the crate can fail to compile with that type unresolved.
### Issue 4 of 5
src/models/organization_membership.rs:34-35
**Missing Roles Rejects Responses**
This makes `roles` required during deserialization. If the API returns an organization membership with the existing `role` field but omits the new `roles` array, create or deactivate membership calls can receive a successful HTTP response and still fail with a serde `missing field 'roles'` error.
```suggestion
/// The list of roles assigned to the user within the organization.
#[serde(default)]
pub roles: Vec<SlimRole>,
```
### Issue 5 of 5
src/models/user_organization_membership.rs:34-35
**Missing Roles Rejects Memberships**
This field is required for every user organization membership response. If list, get, update, or reactivate returns a membership with `role` but without `roles`, deserialization fails instead of returning the membership to the caller.
```suggestion
/// The list of roles assigned to the user within the organization.
#[serde(default)]
pub roles: Vec<SlimRole>,
```
Reviews (1): Last reviewed commit: "chore(generated): add release notes frag..." | Re-trigger Greptile |
| mod audit_log_schema_target; | ||
| mod audit_log_schema_target_input; | ||
| mod audit_logs_retention; | ||
| mod auth_method_mismatch_error; |
There was a problem hiding this comment.
This mod declaration requires a matching Rust source file, but the generated model file is not present. The same missing-file pattern applies to the newly declared pipes and session reauthentication model modules in this file, so the crate can fail to compile with file not found for module before SDK consumers can use it.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/models/mod.rs
Line: 43
Comment:
**Missing Generated Model Files**
This `mod` declaration requires a matching Rust source file, but the generated model file is not present. The same missing-file pattern applies to the newly declared pipes and session reauthentication model modules in this file, so the crate can fail to compile with `file not found for module` before SDK consumers can use it.
How can I resolve this? If you propose a fix, please make it concise.| pub mod session_reauthenticated_data_auth_method; | ||
| pub mod session_reauthenticated_data_status; |
There was a problem hiding this comment.
These new enum module declarations require matching files under src/enums/, but the generated enum files are not present. Building the crate can fail immediately with file not found for module for the session reauthentication auth method and status enums.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/enums/mod.rs
Line: 98-99
Comment:
**Missing Generated Enum Files**
These new enum module declarations require matching files under `src/enums/`, but the generated enum files are not present. Building the crate can fail immediately with `file not found for module` for the session reauthentication auth method and status enums.
How can I resolve this? If you propose a fix, please make it concise.| @@ -337,7 +338,6 @@ mod organization_domain_created_data; | |||
| mod organization_domain_data; | |||
There was a problem hiding this comment.
Removing organization_domain_stand_alone from the model module tree leaves the organization domain resource methods returning a type that is no longer exported through crate::models::*. Calls like get_organization_domain and verify_organization_domain still return OrganizationDomainStandAlone, so the crate can fail to compile with that type unresolved.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/models/mod.rs
Line: 338
Comment:
**Removed Export Still Returned**
Removing `organization_domain_stand_alone` from the model module tree leaves the organization domain resource methods returning a type that is no longer exported through `crate::models::*`. Calls like `get_organization_domain` and `verify_organization_domain` still return `OrganizationDomainStandAlone`, so the crate can fail to compile with that type unresolved.
How can I resolve this? If you propose a fix, please make it concise.| /// The list of roles assigned to the user within the organization. | ||
| pub roles: Vec<SlimRole>, |
There was a problem hiding this comment.
Missing Roles Rejects Responses
This makes roles required during deserialization. If the API returns an organization membership with the existing role field but omits the new roles array, create or deactivate membership calls can receive a successful HTTP response and still fail with a serde missing field 'roles' error.
| /// The list of roles assigned to the user within the organization. | |
| pub roles: Vec<SlimRole>, | |
| /// The list of roles assigned to the user within the organization. | |
| #[serde(default)] | |
| pub roles: Vec<SlimRole>, |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/models/organization_membership.rs
Line: 34-35
Comment:
**Missing Roles Rejects Responses**
This makes `roles` required during deserialization. If the API returns an organization membership with the existing `role` field but omits the new `roles` array, create or deactivate membership calls can receive a successful HTTP response and still fail with a serde `missing field 'roles'` error.
```suggestion
/// The list of roles assigned to the user within the organization.
#[serde(default)]
pub roles: Vec<SlimRole>,
```
How can I resolve this? If you propose a fix, please make it concise.| /// The list of roles assigned to the user within the organization. | ||
| pub roles: Vec<SlimRole>, |
There was a problem hiding this comment.
Missing Roles Rejects Memberships
This field is required for every user organization membership response. If list, get, update, or reactivate returns a membership with role but without roles, deserialization fails instead of returning the membership to the caller.
| /// The list of roles assigned to the user within the organization. | |
| pub roles: Vec<SlimRole>, | |
| /// The list of roles assigned to the user within the organization. | |
| #[serde(default)] | |
| pub roles: Vec<SlimRole>, |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/models/user_organization_membership.rs
Line: 34-35
Comment:
**Missing Roles Rejects Memberships**
This field is required for every user organization membership response. If list, get, update, or reactivate returns a membership with `role` but without `roles`, deserialization fails instead of returning the membership to the caller.
```suggestion
/// The list of roles assigned to the user within the organization.
#[serde(default)]
pub roles: Vec<SlimRole>,
```
How can I resolve this? If you propose a fix, please make it concise.
Summary
Regenerated SDK from spec changes.
Triggered by workos/openapi-spec@75604c7