canton_api_client/models/js_assigned_event.rs
1/*
2 * JSON Ledger API HTTP endpoints
3 *
4 * This specification version fixes the API inconsistencies where certain fields marked as required in the spec are in fact optional. If you use code generation tool based on this file, you might need to adjust the existing application code to handle those fields as optional. If you do not want to change your client code, continue using the OpenAPI specification from the previous Canton 3.4 patch release. MINIMUM_CANTON_VERSION=3.4.12
5 *
6 * The version of the OpenAPI document: 3.4.12-SNAPSHOT
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// JsAssignedEvent : Records that a contract has been assigned, and it can be used on the target synchronizer.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct JsAssignedEvent {
17 /// The ID of the source synchronizer. Must be a valid synchronizer id. Required
18 #[serde(rename = "source")]
19 pub source: String,
20 /// The ID of the target synchronizer. Must be a valid synchronizer id. Required
21 #[serde(rename = "target")]
22 pub target: String,
23 /// The ID from the unassigned event. For correlation capabilities. Must be a valid LedgerString (as described in ``value.proto``). Required
24 #[serde(rename = "reassignmentId")]
25 pub reassignment_id: String,
26 /// Party on whose behalf the assign command was executed. Empty if the assignment happened offline via the repair service. Must be a valid PartyIdString (as described in ``value.proto``). Optional
27 #[serde(rename = "submitter", skip_serializing_if = "Option::is_none")]
28 pub submitter: Option<String>,
29 /// Each corresponding assigned and unassigned event has the same reassignment_counter. This strictly increases with each unassign command for the same contract. Creation of the contract corresponds to reassignment_counter equals zero. Required
30 #[serde(rename = "reassignmentCounter")]
31 pub reassignment_counter: i64,
32 #[serde(rename = "createdEvent")]
33 pub created_event: Box<models::CreatedEvent>,
34}
35
36impl JsAssignedEvent {
37 /// Records that a contract has been assigned, and it can be used on the target synchronizer.
38 pub fn new(source: String, target: String, reassignment_id: String, reassignment_counter: i64, created_event: models::CreatedEvent) -> JsAssignedEvent {
39 JsAssignedEvent {
40 source,
41 target,
42 reassignment_id,
43 submitter: None,
44 reassignment_counter,
45 created_event: Box::new(created_event),
46 }
47 }
48}
49