diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 53a4ea6a1a..951244cb78 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -16201,6 +16201,30 @@ components: required: - data type: object + CaseInvestigationNotebookCreateData: + description: Case investigation notebook creation data. + properties: + type: + $ref: "#/components/schemas/CaseInvestigationNotebookResourceType" + required: + - type + type: object + CaseInvestigationNotebookCreateRequest: + description: Case investigation notebook creation request. + properties: + data: + $ref: "#/components/schemas/CaseInvestigationNotebookCreateData" + required: + - data + type: object + CaseInvestigationNotebookResourceType: + description: Case investigation notebook resource type. + enum: + - notebook + example: notebook + type: string + x-enum-varnames: + - NOTEBOOK CaseLink: description: "A directional link representing a relationship between two entities. At least one entity must be a case." properties: @@ -65373,30 +65397,6 @@ components: type: string x-enum-varnames: - GET_NODE_TYPES_RESPONSE - NotebookCreateData: - description: Notebook creation data - properties: - type: - $ref: "#/components/schemas/NotebookResourceType" - required: - - type - type: object - NotebookCreateRequest: - description: Notebook creation request - properties: - data: - $ref: "#/components/schemas/NotebookCreateData" - required: - - data - type: object - NotebookResourceType: - description: Notebook resource type - enum: - - notebook - example: notebook - type: string - x-enum-varnames: - - NOTEBOOK NotebookTriggerWrapper: description: "Schema for a Notebook-based trigger." properties: @@ -124651,7 +124651,7 @@ paths: - Case Management /api/v2/cases/{case_id}/relationships/notebook: post: - description: Create a new investigation notebook and link it to a case + description: Create a new investigation notebook and link it to a case. operationId: CreateCaseNotebook parameters: - $ref: "#/components/parameters/CaseIDPathParameter" @@ -124664,8 +124664,8 @@ paths: data: type: notebook schema: - $ref: "#/components/schemas/NotebookCreateRequest" - description: Notebook creation request + $ref: "#/components/schemas/CaseInvestigationNotebookCreateRequest" + description: Case investigation notebook creation request. required: true responses: "204": diff --git a/examples/v2_case-management_CreateCaseNotebook.rs b/examples/v2_case-management_CreateCaseNotebook.rs index 5d37999e61..2b5f537568 100644 --- a/examples/v2_case-management_CreateCaseNotebook.rs +++ b/examples/v2_case-management_CreateCaseNotebook.rs @@ -1,13 +1,15 @@ // Create investigation notebook for case returns "No Content" response use datadog_api_client::datadog; use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI; -use datadog_api_client::datadogV2::model::NotebookCreateData; -use datadog_api_client::datadogV2::model::NotebookCreateRequest; -use datadog_api_client::datadogV2::model::NotebookResourceType; +use datadog_api_client::datadogV2::model::CaseInvestigationNotebookCreateData; +use datadog_api_client::datadogV2::model::CaseInvestigationNotebookCreateRequest; +use datadog_api_client::datadogV2::model::CaseInvestigationNotebookResourceType; #[tokio::main] async fn main() { - let body = NotebookCreateRequest::new(NotebookCreateData::new(NotebookResourceType::NOTEBOOK)); + let body = CaseInvestigationNotebookCreateRequest::new( + CaseInvestigationNotebookCreateData::new(CaseInvestigationNotebookResourceType::NOTEBOOK), + ); let configuration = datadog::Configuration::new(); let api = CaseManagementAPI::with_config(configuration); let resp = api.create_case_notebook("case_id".to_string(), body).await; diff --git a/src/datadogV2/api/api_case_management.rs b/src/datadogV2/api/api_case_management.rs index 474c58859f..27a2e94e54 100644 --- a/src/datadogV2/api/api_case_management.rs +++ b/src/datadogV2/api/api_case_management.rs @@ -2363,11 +2363,11 @@ impl CaseManagementAPI { } } - /// Create a new investigation notebook and link it to a case + /// Create a new investigation notebook and link it to a case. pub async fn create_case_notebook( &self, case_id: String, - body: crate::datadogV2::model::NotebookCreateRequest, + body: crate::datadogV2::model::CaseInvestigationNotebookCreateRequest, ) -> Result<(), datadog::Error> { match self .create_case_notebook_with_http_info(case_id, body) @@ -2378,11 +2378,11 @@ impl CaseManagementAPI { } } - /// Create a new investigation notebook and link it to a case + /// Create a new investigation notebook and link it to a case. pub async fn create_case_notebook_with_http_info( &self, case_id: String, - body: crate::datadogV2::model::NotebookCreateRequest, + body: crate::datadogV2::model::CaseInvestigationNotebookCreateRequest, ) -> Result, datadog::Error> { let local_configuration = &self.config; let operation_id = "v2.create_case_notebook"; diff --git a/src/datadogV2/model/mod.rs b/src/datadogV2/model/mod.rs index af41cedad5..ae4c48c892 100644 --- a/src/datadogV2/model/mod.rs +++ b/src/datadogV2/model/mod.rs @@ -1876,12 +1876,12 @@ pub mod model_jira_issue_create_data; pub use self::model_jira_issue_create_data::JiraIssueCreateData; pub mod model_jira_issue_create_attributes; pub use self::model_jira_issue_create_attributes::JiraIssueCreateAttributes; -pub mod model_notebook_create_request; -pub use self::model_notebook_create_request::NotebookCreateRequest; -pub mod model_notebook_create_data; -pub use self::model_notebook_create_data::NotebookCreateData; -pub mod model_notebook_resource_type; -pub use self::model_notebook_resource_type::NotebookResourceType; +pub mod model_case_investigation_notebook_create_request; +pub use self::model_case_investigation_notebook_create_request::CaseInvestigationNotebookCreateRequest; +pub mod model_case_investigation_notebook_create_data; +pub use self::model_case_investigation_notebook_create_data::CaseInvestigationNotebookCreateData; +pub mod model_case_investigation_notebook_resource_type; +pub use self::model_case_investigation_notebook_resource_type::CaseInvestigationNotebookResourceType; pub mod model_service_now_ticket_create_request; pub use self::model_service_now_ticket_create_request::ServiceNowTicketCreateRequest; pub mod model_service_now_ticket_create_data; diff --git a/src/datadogV2/model/model_notebook_create_data.rs b/src/datadogV2/model/model_case_investigation_notebook_create_data.rs similarity index 71% rename from src/datadogV2/model/model_notebook_create_data.rs rename to src/datadogV2/model/model_case_investigation_notebook_create_data.rs index 1bafab0f75..7282713aff 100644 --- a/src/datadogV2/model/model_notebook_create_data.rs +++ b/src/datadogV2/model/model_case_investigation_notebook_create_data.rs @@ -6,14 +6,14 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Notebook creation data +/// Case investigation notebook creation data. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct NotebookCreateData { - /// Notebook resource type +pub struct CaseInvestigationNotebookCreateData { + /// Case investigation notebook resource type. #[serde(rename = "type")] - pub type_: crate::datadogV2::model::NotebookResourceType, + pub type_: crate::datadogV2::model::CaseInvestigationNotebookResourceType, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -21,9 +21,11 @@ pub struct NotebookCreateData { pub(crate) _unparsed: bool, } -impl NotebookCreateData { - pub fn new(type_: crate::datadogV2::model::NotebookResourceType) -> NotebookCreateData { - NotebookCreateData { +impl CaseInvestigationNotebookCreateData { + pub fn new( + type_: crate::datadogV2::model::CaseInvestigationNotebookResourceType, + ) -> CaseInvestigationNotebookCreateData { + CaseInvestigationNotebookCreateData { type_, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, @@ -39,14 +41,14 @@ impl NotebookCreateData { } } -impl<'de> Deserialize<'de> for NotebookCreateData { +impl<'de> Deserialize<'de> for CaseInvestigationNotebookCreateData { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct NotebookCreateDataVisitor; - impl<'a> Visitor<'a> for NotebookCreateDataVisitor { - type Value = NotebookCreateData; + struct CaseInvestigationNotebookCreateDataVisitor; + impl<'a> Visitor<'a> for CaseInvestigationNotebookCreateDataVisitor { + type Value = CaseInvestigationNotebookCreateData; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -56,7 +58,9 @@ impl<'de> Deserialize<'de> for NotebookCreateData { where M: MapAccess<'a>, { - let mut type_: Option = None; + let mut type_: Option< + crate::datadogV2::model::CaseInvestigationNotebookResourceType, + > = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -69,7 +73,7 @@ impl<'de> Deserialize<'de> for NotebookCreateData { type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); if let Some(ref _type_) = type_ { match _type_ { - crate::datadogV2::model::NotebookResourceType::UnparsedObject(_type_) => { + crate::datadogV2::model::CaseInvestigationNotebookResourceType::UnparsedObject(_type_) => { _unparsed = true; }, _ => {} @@ -85,7 +89,7 @@ impl<'de> Deserialize<'de> for NotebookCreateData { } let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; - let content = NotebookCreateData { + let content = CaseInvestigationNotebookCreateData { type_, additional_properties, _unparsed, @@ -95,6 +99,6 @@ impl<'de> Deserialize<'de> for NotebookCreateData { } } - deserializer.deserialize_any(NotebookCreateDataVisitor) + deserializer.deserialize_any(CaseInvestigationNotebookCreateDataVisitor) } } diff --git a/src/datadogV2/model/model_notebook_create_request.rs b/src/datadogV2/model/model_case_investigation_notebook_create_request.rs similarity index 70% rename from src/datadogV2/model/model_notebook_create_request.rs rename to src/datadogV2/model/model_case_investigation_notebook_create_request.rs index f8b9a77db5..336cb50616 100644 --- a/src/datadogV2/model/model_notebook_create_request.rs +++ b/src/datadogV2/model/model_case_investigation_notebook_create_request.rs @@ -6,14 +6,14 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Notebook creation request +/// Case investigation notebook creation request. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct NotebookCreateRequest { - /// Notebook creation data +pub struct CaseInvestigationNotebookCreateRequest { + /// Case investigation notebook creation data. #[serde(rename = "data")] - pub data: crate::datadogV2::model::NotebookCreateData, + pub data: crate::datadogV2::model::CaseInvestigationNotebookCreateData, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -21,9 +21,11 @@ pub struct NotebookCreateRequest { pub(crate) _unparsed: bool, } -impl NotebookCreateRequest { - pub fn new(data: crate::datadogV2::model::NotebookCreateData) -> NotebookCreateRequest { - NotebookCreateRequest { +impl CaseInvestigationNotebookCreateRequest { + pub fn new( + data: crate::datadogV2::model::CaseInvestigationNotebookCreateData, + ) -> CaseInvestigationNotebookCreateRequest { + CaseInvestigationNotebookCreateRequest { data, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, @@ -39,14 +41,14 @@ impl NotebookCreateRequest { } } -impl<'de> Deserialize<'de> for NotebookCreateRequest { +impl<'de> Deserialize<'de> for CaseInvestigationNotebookCreateRequest { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct NotebookCreateRequestVisitor; - impl<'a> Visitor<'a> for NotebookCreateRequestVisitor { - type Value = NotebookCreateRequest; + struct CaseInvestigationNotebookCreateRequestVisitor; + impl<'a> Visitor<'a> for CaseInvestigationNotebookCreateRequestVisitor { + type Value = CaseInvestigationNotebookCreateRequest; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -56,7 +58,8 @@ impl<'de> Deserialize<'de> for NotebookCreateRequest { where M: MapAccess<'a>, { - let mut data: Option = None; + let mut data: Option = + None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -77,7 +80,7 @@ impl<'de> Deserialize<'de> for NotebookCreateRequest { } let data = data.ok_or_else(|| M::Error::missing_field("data"))?; - let content = NotebookCreateRequest { + let content = CaseInvestigationNotebookCreateRequest { data, additional_properties, _unparsed, @@ -87,6 +90,6 @@ impl<'de> Deserialize<'de> for NotebookCreateRequest { } } - deserializer.deserialize_any(NotebookCreateRequestVisitor) + deserializer.deserialize_any(CaseInvestigationNotebookCreateRequestVisitor) } } diff --git a/src/datadogV2/model/model_notebook_resource_type.rs b/src/datadogV2/model/model_case_investigation_notebook_resource_type.rs similarity index 84% rename from src/datadogV2/model/model_notebook_resource_type.rs rename to src/datadogV2/model/model_case_investigation_notebook_resource_type.rs index 26121020fd..d26a14eb34 100644 --- a/src/datadogV2/model/model_notebook_resource_type.rs +++ b/src/datadogV2/model/model_case_investigation_notebook_resource_type.rs @@ -6,12 +6,12 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; #[non_exhaustive] #[derive(Clone, Debug, Eq, PartialEq)] -pub enum NotebookResourceType { +pub enum CaseInvestigationNotebookResourceType { NOTEBOOK, UnparsedObject(crate::datadog::UnparsedObject), } -impl ToString for NotebookResourceType { +impl ToString for CaseInvestigationNotebookResourceType { fn to_string(&self) -> String { match self { Self::NOTEBOOK => String::from("notebook"), @@ -20,7 +20,7 @@ impl ToString for NotebookResourceType { } } -impl Serialize for NotebookResourceType { +impl Serialize for CaseInvestigationNotebookResourceType { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -32,7 +32,7 @@ impl Serialize for NotebookResourceType { } } -impl<'de> Deserialize<'de> for NotebookResourceType { +impl<'de> Deserialize<'de> for CaseInvestigationNotebookResourceType { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>,