/*
* Santati
*
* Santati's HTTP API. Operations under `/api/v0/` take a team API key in `Authorization: Api-Key <key>`; a missing, invalid or under-scoped key is answered with `403`, never `401`. Errors on `/api/v0/` use one of three bodies: `ErrorDetail` (`{\"detail\": ...}`), `FieldErrors` (messages keyed by request field) or `ErrorEnvelope` (`{\"error\": {\"code\", \"message\", \"field\"}}`, returned by event ingestion and log stream quota checks). Lists on `/api/v0/` are cursor-paginated: follow `next` until it is `null`.
*
* The version of the OpenAPI document: 0.2.1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// EventTargetRequest : One object an event acted on, in the producer's own ids. The shape `AuditEventSerializer.get_targets` returns, and the shape ingest accepts on an envelope's `targets` array.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EventTargetRequest {
/// Target kind, e.g. invoice; ingest requires a non-empty string.
#[serde(rename = "type")]
pub r#type: String,
/// The target's id in the producer's own namespace.
#[serde(rename = "id")]
pub id: String,
/// Human-readable target name; empty when unknown.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Target metadata: at most 50 keys, each at most 40 characters of A-Z a-z 0-9 _ . -, each value at most 500 characters.
#[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
pub metadata: Option<std::collections::HashMap<String, String>>,
}
impl EventTargetRequest {
/// One object an event acted on, in the producer's own ids. The shape `AuditEventSerializer.get_targets` returns, and the shape ingest accepts on an envelope's `targets` array.
pub fn new(r#type: String, id: String) -> EventTargetRequest {
EventTargetRequest {
r#type,
id,
name: None,
metadata: None,
}
}
}