Skip to main content

ory_client/models/
event_stream.rs

1/*
2 * Ory APIs
3 *
4 * # Introduction Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.  ## SDKs This document describes the APIs available in the Ory Network. The APIs are available as SDKs for the following languages:  | Language       | Download SDK                                                     | Documentation                                                                        | | -------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------ | | Dart           | [pub.dev](https://pub.dev/packages/ory_client)                   | [README](https://github.com/ory/sdk/blob/master/clients/client/dart/README.md)       | | .NET           | [nuget.org](https://www.nuget.org/packages/Ory.Client/)          | [README](https://github.com/ory/sdk/blob/master/clients/client/dotnet/README.md)     | | Elixir         | [hex.pm](https://hex.pm/packages/ory_client)                     | [README](https://github.com/ory/sdk/blob/master/clients/client/elixir/README.md)     | | Go             | [github.com](https://github.com/ory/client-go)                   | [README](https://github.com/ory/sdk/blob/master/clients/client/go/README.md)         | | Java           | [maven.org](https://search.maven.org/artifact/sh.ory/ory-client) | [README](https://github.com/ory/sdk/blob/master/clients/client/java/README.md)       | | JavaScript     | [npmjs.com](https://www.npmjs.com/package/@ory/client)           | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript/README.md) | | JavaScript (With fetch) | [npmjs.com](https://www.npmjs.com/package/@ory/client-fetch)           | [README](https://github.com/ory/sdk/blob/master/clients/client/typescript-fetch/README.md) |  | PHP            | [packagist.org](https://packagist.org/packages/ory/client)       | [README](https://github.com/ory/sdk/blob/master/clients/client/php/README.md)        | | Python         | [pypi.org](https://pypi.org/project/ory-client/)                 | [README](https://github.com/ory/sdk/blob/master/clients/client/python/README.md)     | | Ruby           | [rubygems.org](https://rubygems.org/gems/ory-client)             | [README](https://github.com/ory/sdk/blob/master/clients/client/ruby/README.md)       | | Rust           | [crates.io](https://crates.io/crates/ory-client)                 | [README](https://github.com/ory/sdk/blob/master/clients/client/rust/README.md)       | 
5 *
6 * The version of the OpenAPI document: v1.22.97
7 * Contact: support@ory.sh
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// EventStream : Event Stream
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct EventStream {
17    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
18    pub created_at: Option<String>,
19    /// The events the stream delivers, sorted. An entry is an exact event name or a pattern such as Session* or *Failed, in which * matches any characters. An empty list delivers every event.
20    #[serde(rename = "event_types", skip_serializing_if = "Option::is_none")]
21    pub event_types: Option<Vec<String>>,
22    /// The major version of the HTTP protocol the endpoint negotiated during the most recent successful connectivity test: 1 for HTTP/1.x, 2 for HTTP/2. Null when the endpoint has not been verified, for example on a paused stream or a non-HTTPS stream.
23    #[serde(rename = "http_protocol_major_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub http_protocol_major_version: Option<Option<i64>>,
25    /// The header that carries the API key, if https_auth_type is api_key.
26    #[serde(rename = "https_auth_header_name", skip_serializing_if = "Option::is_none")]
27    pub https_auth_header_name: Option<String>,
28    /// The API key or bearer token, if https_auth_type is api_key or bearer.  Returned masked. Omit it on write to keep the stored secret.
29    #[serde(rename = "https_auth_secret", skip_serializing_if = "Option::is_none")]
30    pub https_auth_secret: Option<String>,
31    /// How deliveries to the HTTPS endpoint authenticate, if type is HTTPS. `api_key` sends the secret in the header named by https_auth_header_name. `bearer` sends it as `Authorization: Bearer`. Credentials in the endpoint URL are sent as Basic auth either way.
32    #[serde(rename = "https_auth_type", skip_serializing_if = "Option::is_none")]
33    pub https_auth_type: Option<HttpsAuthTypeEnum>,
34    /// The HTTPS endpoint, if type is HTTPS.  Returned with its userinfo and query values masked. Omit it on write to keep the stored endpoint.
35    #[serde(rename = "https_endpoint", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub https_endpoint: Option<Option<String>>,
37    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
38    pub id: Option<String>,
39    /// Whether events include the security context of the request that caused them: the client IP address, user agent, HTTP method, host, and path.
40    #[serde(rename = "include_security_context", skip_serializing_if = "Option::is_none")]
41    pub include_security_context: Option<bool>,
42    /// The AWS IAM role ARN assumed when publishing to the SNS topic, if type is SNS.
43    #[serde(rename = "role_arn", skip_serializing_if = "Option::is_none")]
44    pub role_arn: Option<String>,
45    /// The status of the event stream. A paused event stream does not forward any events until it is set back to active.
46    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
47    pub status: Option<StatusEnum>,
48    /// The AWS SNS topic ARN, if type is SNS.
49    #[serde(rename = "topic_arn", skip_serializing_if = "Option::is_none")]
50    pub topic_arn: Option<String>,
51    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
52    pub r#type: Option<String>,
53    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
54    pub updated_at: Option<String>,
55}
56
57impl EventStream {
58    /// Event Stream
59    pub fn new() -> EventStream {
60        EventStream {
61            created_at: None,
62            event_types: None,
63            http_protocol_major_version: None,
64            https_auth_header_name: None,
65            https_auth_secret: None,
66            https_auth_type: None,
67            https_endpoint: None,
68            id: None,
69            include_security_context: None,
70            role_arn: None,
71            status: None,
72            topic_arn: None,
73            r#type: None,
74            updated_at: None,
75        }
76    }
77}
78/// How deliveries to the HTTPS endpoint authenticate, if type is HTTPS. `api_key` sends the secret in the header named by https_auth_header_name. `bearer` sends it as `Authorization: Bearer`. Credentials in the endpoint URL are sent as Basic auth either way.
79#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
80pub enum HttpsAuthTypeEnum {
81    #[serde(rename = "none")]
82    None,
83    #[serde(rename = "api_key")]
84    ApiKey,
85    #[serde(rename = "bearer")]
86    Bearer,
87}
88
89impl Default for HttpsAuthTypeEnum {
90    fn default() -> HttpsAuthTypeEnum {
91        Self::None
92    }
93}
94/// The status of the event stream. A paused event stream does not forward any events until it is set back to active.
95#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
96pub enum StatusEnum {
97    #[serde(rename = "active")]
98    Active,
99    #[serde(rename = "paused")]
100    Paused,
101}
102
103impl Default for StatusEnum {
104    fn default() -> StatusEnum {
105        Self::Active
106    }
107}
108