1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* public
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.97.5
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// EntitlementResponse : Detailed view of a single entitlement: identity, integration type, integration-specific configuration, and metadata.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EntitlementResponse {
/// Identifier of the business that owns this entitlement.
#[serde(rename = "business_id")]
pub business_id: String,
/// Timestamp when the entitlement was created.
#[serde(rename = "created_at")]
pub created_at: chrono::DateTime<chrono::FixedOffset>,
/// Optional description supplied at creation.
#[serde(
rename = "description",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub description: Option<Option<String>>,
/// Unique identifier of the entitlement.
#[serde(rename = "id")]
pub id: String,
/// Integration-specific configuration. For `digital_files` entitlements this includes presigned download URLs for each attached file.
#[serde(rename = "integration_config")]
pub integration_config: Box<models::IntegrationConfigResponse>,
/// Platform integration this entitlement uses.
#[serde(rename = "integration_type")]
pub integration_type: models::EntitlementIntegrationType,
/// Always `true` for entitlements returned by the public API; soft-deleted entitlements are not returned.
#[serde(rename = "is_active")]
pub is_active: bool,
/// Arbitrary key-value metadata supplied at creation or via PATCH.
#[serde(rename = "metadata")]
pub metadata: std::collections::HashMap<String, String>,
/// Display name supplied at creation.
#[serde(rename = "name")]
pub name: String,
/// Timestamp when the entitlement was last modified.
#[serde(rename = "updated_at")]
pub updated_at: chrono::DateTime<chrono::FixedOffset>,
}
impl EntitlementResponse {
/// Detailed view of a single entitlement: identity, integration type, integration-specific configuration, and metadata.
pub fn new(
business_id: String,
created_at: chrono::DateTime<chrono::FixedOffset>,
id: String,
integration_config: models::IntegrationConfigResponse,
integration_type: models::EntitlementIntegrationType,
is_active: bool,
metadata: std::collections::HashMap<String, String>,
name: String,
updated_at: chrono::DateTime<chrono::FixedOffset>,
) -> EntitlementResponse {
EntitlementResponse {
business_id,
created_at,
description: None,
id,
integration_config: Box::new(integration_config),
integration_type,
is_active,
metadata,
name,
updated_at,
}
}
}