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<RawVersion>,
}
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<RawVersion>
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: impl Into<RawVersion>) -> Self
pub fn with_expected_version(self, version: impl Into<RawVersion>) -> 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::{RawVersion, HttpVersion};
use serde_json::json;
let version: HttpVersion = "\"abc123\"".parse().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 moreSource§impl Debug for ScimOperationRequest
impl Debug for ScimOperationRequest
Source§impl PartialEq for ScimOperationRequest
impl PartialEq for ScimOperationRequest
impl StructuralPartialEq for ScimOperationRequest
Auto Trait Implementations§
impl Freeze for ScimOperationRequest
impl RefUnwindSafe for ScimOperationRequest
impl Send for ScimOperationRequest
impl Sync for ScimOperationRequest
impl Unpin for ScimOperationRequest
impl UnwindSafe for ScimOperationRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more