pub struct ScimOperationRequest {
pub operation: ScimOperationType,
pub resource_type: String,
pub resource_id: Option<String>,
pub data: Option<Value>,
pub query: Option<ScimQuery>,
pub tenant_context: Option<TenantContext>,
pub request_id: Option<String>,
pub expected_version: Option<ScimVersion>,
}
Expand description
Structured request for SCIM operations
This type encapsulates all the information needed to perform a SCIM operation in a transport-agnostic way.
Fields§
§operation: ScimOperationType
The type of operation to perform
resource_type: String
The resource type (e.g., “User”, “Group”)
resource_id: Option<String>
Resource ID for operations that target a specific resource
data: Option<Value>
Data payload for create/update operations
query: Option<ScimQuery>
Query parameters for list/search operations
tenant_context: Option<TenantContext>
Tenant context for multi-tenant operations
request_id: Option<String>
Request ID for tracing and correlation
expected_version: Option<ScimVersion>
Expected version for conditional operations
Implementations§
Source§impl ScimOperationRequest
impl ScimOperationRequest
Sourcepub fn create(resource_type: impl Into<String>, data: Value) -> Self
pub fn create(resource_type: impl Into<String>, data: Value) -> Self
Create a new create operation request.
Sourcepub fn get(
resource_type: impl Into<String>,
resource_id: impl Into<String>,
) -> Self
pub fn get( resource_type: impl Into<String>, resource_id: impl Into<String>, ) -> Self
Create a new get operation request.
Sourcepub fn update(
resource_type: impl Into<String>,
resource_id: impl Into<String>,
data: Value,
) -> Self
pub fn update( resource_type: impl Into<String>, resource_id: impl Into<String>, data: Value, ) -> Self
Create a new update operation request.
Sourcepub fn delete(
resource_type: impl Into<String>,
resource_id: impl Into<String>,
) -> Self
pub fn delete( resource_type: impl Into<String>, resource_id: impl Into<String>, ) -> Self
Create a new delete operation request.
Sourcepub fn search(
resource_type: impl Into<String>,
attribute: impl Into<String>,
value: Value,
) -> Self
pub fn search( resource_type: impl Into<String>, attribute: impl Into<String>, value: Value, ) -> Self
Create a new search operation request.
Sourcepub fn get_schemas() -> Self
pub fn get_schemas() -> Self
Create a new get schemas operation request.
Sourcepub fn get_schema(schema_id: impl Into<String>) -> Self
pub fn get_schema(schema_id: impl Into<String>) -> Self
Create a new get schema operation request.
Sourcepub fn exists(
resource_type: impl Into<String>,
resource_id: impl Into<String>,
) -> Self
pub fn exists( resource_type: impl Into<String>, resource_id: impl Into<String>, ) -> Self
Create a new resource exists operation request.
Sourcepub fn with_tenant(self, tenant_context: TenantContext) -> Self
pub fn with_tenant(self, tenant_context: TenantContext) -> Self
Add tenant context to the request.
Sourcepub fn with_request_id(self, request_id: impl Into<String>) -> Self
pub fn with_request_id(self, request_id: impl Into<String>) -> Self
Add request ID to the request.
Sourcepub fn with_query(self, query: ScimQuery) -> Self
pub fn with_query(self, query: ScimQuery) -> Self
Add query parameters to the request.
Sourcepub fn with_expected_version(self, version: ScimVersion) -> Self
pub fn with_expected_version(self, version: ScimVersion) -> Self
Add expected version for conditional operations.
This enables ETag-based concurrency control for update and delete operations. The operation will only succeed if the current resource version matches the expected version.
§Examples
use scim_server::operation_handler::ScimOperationRequest;
use scim_server::resource::version::ScimVersion;
use serde_json::json;
let version = ScimVersion::parse_http_header("\"abc123\"").unwrap();
let request = ScimOperationRequest::update(
"User",
"123",
json!({"userName": "updated.name"})
).with_expected_version(version);
Trait Implementations§
Source§impl Clone for ScimOperationRequest
impl Clone for ScimOperationRequest
Source§fn clone(&self) -> ScimOperationRequest
fn clone(&self) -> ScimOperationRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more