ScimOperationRequest

Struct ScimOperationRequest 

Source
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

Source

pub fn create(resource_type: impl Into<String>, data: Value) -> Self

Create a new create operation request.

Source

pub fn get( resource_type: impl Into<String>, resource_id: impl Into<String>, ) -> Self

Create a new get operation request.

Source

pub fn update( resource_type: impl Into<String>, resource_id: impl Into<String>, data: Value, ) -> Self

Create a new update operation request.

Source

pub fn delete( resource_type: impl Into<String>, resource_id: impl Into<String>, ) -> Self

Create a new delete operation request.

Source

pub fn list(resource_type: impl Into<String>) -> Self

Create a new list operation request.

Source

pub fn search( resource_type: impl Into<String>, attribute: impl Into<String>, value: Value, ) -> Self

Create a new search operation request.

Source

pub fn get_schemas() -> Self

Create a new get schemas operation request.

Source

pub fn get_schema(schema_id: impl Into<String>) -> Self

Create a new get schema operation request.

Source

pub fn exists( resource_type: impl Into<String>, resource_id: impl Into<String>, ) -> Self

Create a new resource exists operation request.

Source

pub fn with_tenant(self, tenant_context: TenantContext) -> Self

Add tenant context to the request.

Source

pub fn with_request_id(self, request_id: impl Into<String>) -> Self

Add request ID to the request.

Source

pub fn with_query(self, query: ScimQuery) -> Self

Add query parameters to the request.

Source

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

Source§

fn clone(&self) -> ScimOperationRequest

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ScimOperationRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ScimOperationRequest

Source§

fn eq(&self, other: &ScimOperationRequest) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ScimOperationRequest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> TenantValidator for T

Source§

fn validate_tenant_context( &self, expected_tenant_id: &str, context: &RequestContext, ) -> Result<(), String>

Validate that the context has the expected tenant.
Source§

fn validate_single_tenant_context( &self, context: &RequestContext, ) -> Result<(), String>

Validate that the context is for single-tenant operation.
Source§

fn require_tenant_context(&self, context: &RequestContext) -> Result<(), String>

Extract tenant context or return error for multi-tenant operations.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.