ory_kratos_client/models/json_patch.rs
1/*
2 * Ory Identities API
3 *
4 * This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
5 *
6 * The version of the OpenAPI document: v26.2.0
7 * Contact: office@ory.sh
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// JsonPatch : A JSONPatch document as defined by RFC 6902
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct JsonPatch {
17 /// This field is used together with operation \"move\" and uses JSON Pointer notation. Learn more [about JSON Pointers](https://datatracker.ietf.org/doc/html/rfc6901#section-5).
18 #[serde(rename = "from", skip_serializing_if = "Option::is_none")]
19 pub from: Option<String>,
20 /// The operation to be performed. One of \"add\", \"remove\", \"replace\", \"move\", \"copy\", or \"test\".
21 #[serde(rename = "op")]
22 pub op: String,
23 /// The path to the target path. Uses JSON pointer notation. Learn more [about JSON Pointers](https://datatracker.ietf.org/doc/html/rfc6901#section-5).
24 #[serde(rename = "path")]
25 pub path: String,
26 /// The value to be used within the operations. Learn more [about JSON Pointers](https://datatracker.ietf.org/doc/html/rfc6901#section-5).
27 #[serde(rename = "value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28 pub value: Option<Option<serde_json::Value>>,
29}
30
31impl JsonPatch {
32 /// A JSONPatch document as defined by RFC 6902
33 pub fn new(op: String, path: String) -> JsonPatch {
34 JsonPatch {
35 from: None,
36 op,
37 path,
38 value: None,
39 }
40 }
41}
42