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.87
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 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.
20 #[serde(rename = "http_protocol_major_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21 pub http_protocol_major_version: Option<Option<i64>>,
22 /// The header that carries the API key, if https_auth_type is api_key.
23 #[serde(rename = "https_auth_header_name", skip_serializing_if = "Option::is_none")]
24 pub https_auth_header_name: Option<String>,
25 /// 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.
26 #[serde(rename = "https_auth_secret", skip_serializing_if = "Option::is_none")]
27 pub https_auth_secret: Option<String>,
28 /// 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.
29 #[serde(rename = "https_auth_type", skip_serializing_if = "Option::is_none")]
30 pub https_auth_type: Option<HttpsAuthTypeEnum>,
31 /// The HTTPS endpoint, if type is HTTPS. Returned with its userinfo and query values masked. Omit it on write to keep the stored endpoint.
32 #[serde(rename = "https_endpoint", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33 pub https_endpoint: Option<Option<String>>,
34 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
35 pub id: Option<String>,
36 /// The AWS IAM role ARN assumed when publishing to the SNS topic, if type is SNS.
37 #[serde(rename = "role_arn", skip_serializing_if = "Option::is_none")]
38 pub role_arn: Option<String>,
39 /// The status of the event stream. A paused event stream does not forward any events until it is set back to active.
40 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
41 pub status: Option<StatusEnum>,
42 /// The AWS SNS topic ARN, if type is SNS.
43 #[serde(rename = "topic_arn", skip_serializing_if = "Option::is_none")]
44 pub topic_arn: Option<String>,
45 #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
46 pub r#type: Option<String>,
47 #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
48 pub updated_at: Option<String>,
49}
50
51impl EventStream {
52 /// Event Stream
53 pub fn new() -> EventStream {
54 EventStream {
55 created_at: None,
56 http_protocol_major_version: None,
57 https_auth_header_name: None,
58 https_auth_secret: None,
59 https_auth_type: None,
60 https_endpoint: None,
61 id: None,
62 role_arn: None,
63 status: None,
64 topic_arn: None,
65 r#type: None,
66 updated_at: None,
67 }
68 }
69}
70/// 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.
71#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
72pub enum HttpsAuthTypeEnum {
73 #[serde(rename = "none")]
74 None,
75 #[serde(rename = "api_key")]
76 ApiKey,
77 #[serde(rename = "bearer")]
78 Bearer,
79}
80
81impl Default for HttpsAuthTypeEnum {
82 fn default() -> HttpsAuthTypeEnum {
83 Self::None
84 }
85}
86/// The status of the event stream. A paused event stream does not forward any events until it is set back to active.
87#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
88pub enum StatusEnum {
89 #[serde(rename = "active")]
90 Active,
91 #[serde(rename = "paused")]
92 Paused,
93}
94
95impl Default for StatusEnum {
96 fn default() -> StatusEnum {
97 Self::Active
98 }
99}
100