ory_client/models/create_event_stream_body.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/// CreateEventStreamBody : Create Event Stream Request Body
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CreateEventStreamBody {
17 /// The header that carries the API key. Required if https_auth_type is api_key. It must not be a header Ory sets itself, or a connection-specific header such as Connection, Keep-Alive, Upgrade, or TE, which HTTP/2 does not allow.
18 #[serde(rename = "https_auth_header_name", skip_serializing_if = "Option::is_none")]
19 pub https_auth_header_name: Option<String>,
20 /// The API key or bearer token. Required if https_auth_type is api_key or bearer. At most 4096 bytes.
21 #[serde(rename = "https_auth_secret", skip_serializing_if = "Option::is_none")]
22 pub https_auth_secret: Option<String>,
23 /// How deliveries to the HTTPS endpoint authenticate. Defaults to none. `api_key` sends https_auth_secret in the header named by https_auth_header_name. `bearer` sends it as `Authorization: Bearer`.
24 #[serde(rename = "https_auth_type", skip_serializing_if = "Option::is_none")]
25 pub https_auth_type: Option<HttpsAuthTypeEnum>,
26 /// The HTTPS endpoint URL to send events to. Required if type is https.
27 #[serde(rename = "https_endpoint", skip_serializing_if = "Option::is_none")]
28 pub https_endpoint: Option<String>,
29 /// The AWS IAM role ARN to assume when publishing to the SNS topic. Required if type is sns.
30 #[serde(rename = "role_arn", skip_serializing_if = "Option::is_none")]
31 pub role_arn: Option<String>,
32 /// The status of the event stream. Defaults to active. A paused stream is created but does not forward any events until it is set to active.
33 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
34 pub status: Option<StatusEnum>,
35 /// The AWS SNS topic ARN. Required if type is sns.
36 #[serde(rename = "topic_arn", skip_serializing_if = "Option::is_none")]
37 pub topic_arn: Option<String>,
38 /// The type of the event stream (AWS SNS or HTTPS webhook).
39 #[serde(rename = "type")]
40 pub r#type: TypeEnum,
41}
42
43impl CreateEventStreamBody {
44 /// Create Event Stream Request Body
45 pub fn new(r#type: TypeEnum) -> CreateEventStreamBody {
46 CreateEventStreamBody {
47 https_auth_header_name: None,
48 https_auth_secret: None,
49 https_auth_type: None,
50 https_endpoint: None,
51 role_arn: None,
52 status: None,
53 topic_arn: None,
54 r#type,
55 }
56 }
57}
58/// How deliveries to the HTTPS endpoint authenticate. Defaults to none. `api_key` sends https_auth_secret in the header named by https_auth_header_name. `bearer` sends it as `Authorization: Bearer`.
59#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
60pub enum HttpsAuthTypeEnum {
61 #[serde(rename = "none")]
62 None,
63 #[serde(rename = "api_key")]
64 ApiKey,
65 #[serde(rename = "bearer")]
66 Bearer,
67}
68
69impl Default for HttpsAuthTypeEnum {
70 fn default() -> HttpsAuthTypeEnum {
71 Self::None
72 }
73}
74/// The status of the event stream. Defaults to active. A paused stream is created but does not forward any events until it is set to active.
75#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
76pub enum StatusEnum {
77 #[serde(rename = "active")]
78 Active,
79 #[serde(rename = "paused")]
80 Paused,
81}
82
83impl Default for StatusEnum {
84 fn default() -> StatusEnum {
85 Self::Active
86 }
87}
88/// The type of the event stream (AWS SNS or HTTPS webhook).
89#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
90pub enum TypeEnum {
91 #[serde(rename = "sns")]
92 Sns,
93 #[serde(rename = "https")]
94 Https,
95}
96
97impl Default for TypeEnum {
98 fn default() -> TypeEnum {
99 Self::Sns
100 }
101}
102