diff --git a/Cargo.toml b/Cargo.toml index 20de3f7f..607ec8f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ [package] name = "famedly-zitadel-rust-client" description = "HTTP client for Zitadel IdP built by Famedly" -version = "0.9.3" +version = "0.10.0" authors = [] edition = "2024" resolver = "2" diff --git a/src/v2/actions/mod.rs b/src/v2/actions/mod.rs index d4bb8d19..2e25787e 100644 --- a/src/v2/actions/mod.rs +++ b/src/v2/actions/mod.rs @@ -19,10 +19,9 @@ impl Zitadel { /// [Create Target](https://zitadel.com/docs/apis/resources/action_service_v2/action-service-create-target) pub async fn create_target( &self, - req: &V2betaCreateTargetRequest, - ) -> Result { - let request = - self.client.post(self.make_url("v2beta/actions/targets")?).json(req).build()?; + req: &V2CreateTargetRequest, + ) -> Result { + let request = self.client.post(self.make_url("v2/actions/targets")?).json(req).build()?; Ok(self.send_request(request).await?) } @@ -31,19 +30,16 @@ impl Zitadel { &self, id: &str, req: &ActionServiceUpdateTargetBody, - ) -> Result { - let request = self - .client - .post(self.make_url("v2beta/actions/targets/")?.join(id)?) - .json(req) - .build()?; + ) -> Result { + let request = + self.client.post(self.make_url("v2/actions/targets/")?.join(id)?).json(req).build()?; Ok(self.send_request(request).await?) } /// [Delete Target](https://zitadel.com/docs/apis/resources/action_service_v2/action-service-delete-target) - pub async fn delete_target(&self, id: &str) -> Result { + pub async fn delete_target(&self, id: &str) -> Result { let request = - self.client.delete(self.make_url("v2beta/actions/targets/")?.join(id)?).build()?; + self.client.delete(self.make_url("v2/actions/targets/")?.join(id)?).build()?; Ok(self.send_request(request).await?) } @@ -51,24 +47,24 @@ impl Zitadel { pub fn list_targets<'a>( &'a self, params: &'a Option, - sort_by: &'a Option, - filters: &'a Option>, - ) -> impl Stream> + Send { + sort_by: &'a Option, + filters: &'a Option>, + ) -> impl Stream> + Send { // TODO: factor out pagination. This endpoint is an exception because all others // return `result` field, but this one returns `targets`. So it's a quick fix. use crate::v2::pagination::PaginationRequest; #[derive(Debug, Clone, serde::Deserialize)] struct Response { #[serde(default)] - targets: Vec, + targets: Vec, } futures::stream::try_unfold((0, VecDeque::new()), async move |(mut page, mut buffered)| { if let Some(x) = buffered.pop_front() { return Ok(Some((x, (page, buffered)))); } - let url = self.make_url("v2beta/actions/targets/search")?; - let body: V2betaListTargetsRequest = + let url = self.make_url("v2/actions/targets/search")?; + let body: V2ListTargetsRequest = (params.clone(), sort_by.clone(), filters.clone()).to_paginated_request(page); let req = self.client.post(url.clone()).json(&body).build()?; buffered = self.send_request::(req).await?.targets.into(); @@ -84,10 +80,9 @@ impl Zitadel { /// [Set Execution | ZITADEL Docs](https://zitadel.com/docs/apis/resources/action_service_v2/action-service-set-execution) pub async fn set_execution( &self, - req: &V2betaSetExecutionRequest, - ) -> Result { - let request = - self.client.put(self.make_url("v2beta/actions/executions")?).json(req).build()?; + req: &V2SetExecutionRequest, + ) -> Result { + let request = self.client.put(self.make_url("v2/actions/executions")?).json(req).build()?; Ok(self.send_request(request).await?) } @@ -95,9 +90,9 @@ impl Zitadel { pub fn list_executions<'a>( &'a self, params: &'a Option, - sort_by: &'a Option, - filters: &'a Option>, - ) -> impl Stream> + Send + use<'a> { + sort_by: &'a Option, + filters: &'a Option>, + ) -> impl Stream> + Send + use<'a> { // TODO: factor out pagination. This endpoint is an exception because all others // accepts pagination parameters in the json body, this one as query params use crate::v2::pagination::PaginationRequest; @@ -107,12 +102,12 @@ impl Zitadel { return Ok(Some((x, (page, buffered)))); } - let url = self.make_url("v2beta/actions/executions/search")?; - let body: V2betaListExecutionsRequest = + let url = self.make_url("v2/actions/executions/search")?; + let body: V2ListExecutionsRequest = (params.clone(), sort_by.clone(), filters.clone()).to_paginated_request(page); let req = self.client.post(url.clone()).json(&body).build()?; buffered = self - .send_request::(req) + .send_request::(req) .await? .executions .unwrap_or_default() diff --git a/src/v2/actions/models/action_service_update_target_body.rs b/src/v2/actions/models/action_service_update_target_body.rs index 0fe30a6b..7c2e161b 100644 --- a/src/v2/actions/models/action_service_update_target_body.rs +++ b/src/v2/actions/models/action_service_update_target_body.rs @@ -25,15 +25,15 @@ pub struct ActionServiceUpdateTargetBody { /// Wait for response but response body is ignored, status is checked, call /// is sent as post. #[serde(rename = "restWebhook")] - rest_webhook: Option, + rest_webhook: Option, /// Wait for response and response body is used, status is checked, call is /// sent as post. #[serde(rename = "restCall")] - rest_call: Option, + rest_call: Option, /// Call is executed in parallel to others, ZITADEL does not wait until the /// call is finished. The state is ignored, call is sent as post. #[serde(rename = "restAsync")] - rest_async: Option, + rest_async: Option, /// Timeout defines the duration until ZITADEL cancels the execution. If the /// target doesn't respond before this timeout expires, then the connection /// is closed and the action fails. Depending on the target type and @@ -52,6 +52,11 @@ pub struct ActionServiceUpdateTargetBody { /// longer expirations in the future. #[serde(rename = "expirationSigningKey")] expiration_signing_key: Option, + /// How the payload is formatted and secured when sent to the target. + /// Defaults to `PAYLOAD_TYPE_JSON` (plain JSON with a signature header). + /// Use `PAYLOAD_TYPE_JWT` for a signed JWT body. + #[serde(rename = "payloadType", skip_serializing_if = "Option::is_none")] + payload_type: Option, } impl ActionServiceUpdateTargetBody { @@ -64,9 +69,30 @@ impl ActionServiceUpdateTargetBody { timeout: None, endpoint: None, expiration_signing_key: None, + payload_type: None, } } + pub fn set_payload_type(&mut self, payload_type: super::V2PayloadType) { + self.payload_type = Some(payload_type); + } + + pub fn with_payload_type( + mut self, + payload_type: super::V2PayloadType, + ) -> ActionServiceUpdateTargetBody { + self.payload_type = Some(payload_type); + self + } + + pub fn payload_type(&self) -> Option<&super::V2PayloadType> { + self.payload_type.as_ref() + } + + pub fn reset_payload_type(&mut self) { + self.payload_type = None; + } + pub fn set_name(&mut self, name: String) { self.name = Some(name); } @@ -84,19 +110,19 @@ impl ActionServiceUpdateTargetBody { self.name = None; } - pub fn set_rest_webhook(&mut self, rest_webhook: super::V2betaRestWebhook) { + pub fn set_rest_webhook(&mut self, rest_webhook: super::V2RestWebhook) { self.rest_webhook = Some(rest_webhook); } pub fn with_rest_webhook( mut self, - rest_webhook: super::V2betaRestWebhook, + rest_webhook: super::V2RestWebhook, ) -> ActionServiceUpdateTargetBody { self.rest_webhook = Some(rest_webhook); self } - pub fn rest_webhook(&self) -> Option<&super::V2betaRestWebhook> { + pub fn rest_webhook(&self) -> Option<&super::V2RestWebhook> { self.rest_webhook.as_ref() } @@ -104,19 +130,16 @@ impl ActionServiceUpdateTargetBody { self.rest_webhook = None; } - pub fn set_rest_call(&mut self, rest_call: super::V2betaRestCall) { + pub fn set_rest_call(&mut self, rest_call: super::V2RestCall) { self.rest_call = Some(rest_call); } - pub fn with_rest_call( - mut self, - rest_call: super::V2betaRestCall, - ) -> ActionServiceUpdateTargetBody { + pub fn with_rest_call(mut self, rest_call: super::V2RestCall) -> ActionServiceUpdateTargetBody { self.rest_call = Some(rest_call); self } - pub fn rest_call(&self) -> Option<&super::V2betaRestCall> { + pub fn rest_call(&self) -> Option<&super::V2RestCall> { self.rest_call.as_ref() } @@ -124,19 +147,19 @@ impl ActionServiceUpdateTargetBody { self.rest_call = None; } - pub fn set_rest_async(&mut self, rest_async: super::V2betaRestAsync) { + pub fn set_rest_async(&mut self, rest_async: super::V2RestAsync) { self.rest_async = Some(rest_async); } pub fn with_rest_async( mut self, - rest_async: super::V2betaRestAsync, + rest_async: super::V2RestAsync, ) -> ActionServiceUpdateTargetBody { self.rest_async = Some(rest_async); self } - pub fn rest_async(&self) -> Option<&super::V2betaRestAsync> { + pub fn rest_async(&self) -> Option<&super::V2RestAsync> { self.rest_async.as_ref() } diff --git a/src/v2/actions/models/mod.rs b/src/v2/actions/models/mod.rs index 487822f9..9324a4a3 100644 --- a/src/v2/actions/models/mod.rs +++ b/src/v2/actions/models/mod.rs @@ -18,77 +18,79 @@ mod protobuf_any; pub use self::protobuf_any::ProtobufAny; mod rpc_status; pub use self::rpc_status::RpcStatus; -mod v2beta_condition; -pub use self::v2beta_condition::V2betaCondition; -mod v2beta_create_target_request; -pub use self::v2beta_create_target_request::V2betaCreateTargetRequest; -mod v2beta_create_target_response; -pub use self::v2beta_create_target_response::V2betaCreateTargetResponse; -mod v2beta_delete_target_response; -pub use self::v2beta_delete_target_response::V2betaDeleteTargetResponse; -mod v2beta_event_execution; -pub use self::v2beta_event_execution::V2betaEventExecution; -mod v2beta_execution; -pub use self::v2beta_execution::V2betaExecution; -mod v2beta_execution_field_name; -pub use self::v2beta_execution_field_name::V2betaExecutionFieldName; -mod v2beta_execution_search_filter; -pub use self::v2beta_execution_search_filter::V2betaExecutionSearchFilter; -mod v2beta_execution_type; -pub use self::v2beta_execution_type::V2betaExecutionType; -mod v2beta_execution_type_filter; -pub use self::v2beta_execution_type_filter::V2betaExecutionTypeFilter; -mod v2beta_function_execution; -pub use self::v2beta_function_execution::V2betaFunctionExecution; -mod v2beta_get_target_response; -pub use self::v2beta_get_target_response::V2betaGetTargetResponse; -mod v2beta_in_conditions_filter; -pub use self::v2beta_in_conditions_filter::V2betaInConditionsFilter; -mod v2beta_in_target_ids_filter; -pub use self::v2beta_in_target_ids_filter::V2betaInTargetIdsFilter; -mod v2beta_list_execution_functions_response; -pub use self::v2beta_list_execution_functions_response::V2betaListExecutionFunctionsResponse; -mod v2beta_list_execution_methods_response; -pub use self::v2beta_list_execution_methods_response::V2betaListExecutionMethodsResponse; -mod v2beta_list_execution_services_response; -pub use self::v2beta_list_execution_services_response::V2betaListExecutionServicesResponse; -mod v2beta_list_executions_response; -pub use self::v2beta_list_executions_response::V2betaListExecutionsResponse; -mod v2beta_list_targets_request; -pub use self::v2beta_list_targets_request::V2betaListTargetsRequest; -mod v2beta_list_executions_request; -pub use self::v2beta_list_executions_request::V2betaListExecutionsRequest; -mod v2beta_list_targets_response; -pub use self::v2beta_list_targets_response::V2betaListTargetsResponse; -mod v2beta_pagination_request; -pub use self::v2beta_pagination_request::V2betaPaginationRequest; -mod v2beta_pagination_response; -pub use self::v2beta_pagination_response::V2betaPaginationResponse; -mod v2beta_request_execution; -pub use self::v2beta_request_execution::V2betaRequestExecution; -mod v2beta_response_execution; -pub use self::v2beta_response_execution::V2betaResponseExecution; -mod v2beta_rest_async; -pub use self::v2beta_rest_async::V2betaRestAsync; -mod v2beta_rest_call; -pub use self::v2beta_rest_call::V2betaRestCall; -mod v2beta_rest_webhook; -pub use self::v2beta_rest_webhook::V2betaRestWebhook; -mod v2beta_set_execution_request; -pub use self::v2beta_set_execution_request::V2betaSetExecutionRequest; -mod v2beta_set_execution_response; -pub use self::v2beta_set_execution_response::V2betaSetExecutionResponse; -mod v2beta_target; -pub use self::v2beta_target::V2betaTarget; -mod v2beta_target_field_name; -pub use self::v2beta_target_field_name::V2betaTargetFieldName; -mod v2beta_target_filter; -pub use self::v2beta_target_filter::V2betaTargetFilter; -mod v2beta_target_name_filter; -pub use self::v2beta_target_name_filter::V2betaTargetNameFilter; -mod v2beta_target_search_filter; -pub use self::v2beta_target_search_filter::V2betaTargetSearchFilter; -mod v2beta_text_filter_method; -pub use self::v2beta_text_filter_method::V2betaTextFilterMethod; -mod v2beta_update_target_response; -pub use self::v2beta_update_target_response::V2betaUpdateTargetResponse; +mod v2_condition; +pub use self::v2_condition::V2Condition; +mod v2_create_target_request; +pub use self::v2_create_target_request::V2CreateTargetRequest; +mod v2_create_target_response; +pub use self::v2_create_target_response::V2CreateTargetResponse; +mod v2_delete_target_response; +pub use self::v2_delete_target_response::V2DeleteTargetResponse; +mod v2_event_execution; +pub use self::v2_event_execution::V2EventExecution; +mod v2_execution; +pub use self::v2_execution::V2Execution; +mod v2_execution_field_name; +pub use self::v2_execution_field_name::V2ExecutionFieldName; +mod v2_execution_search_filter; +pub use self::v2_execution_search_filter::V2ExecutionSearchFilter; +mod v2_execution_type; +pub use self::v2_execution_type::V2ExecutionType; +mod v2_execution_type_filter; +pub use self::v2_execution_type_filter::V2ExecutionTypeFilter; +mod v2_function_execution; +pub use self::v2_function_execution::V2FunctionExecution; +mod v2_get_target_response; +pub use self::v2_get_target_response::V2GetTargetResponse; +mod v2_in_conditions_filter; +pub use self::v2_in_conditions_filter::V2InConditionsFilter; +mod v2_in_target_ids_filter; +pub use self::v2_in_target_ids_filter::V2InTargetIdsFilter; +mod v2_list_execution_functions_response; +pub use self::v2_list_execution_functions_response::V2ListExecutionFunctionsResponse; +mod v2_list_execution_methods_response; +pub use self::v2_list_execution_methods_response::V2ListExecutionMethodsResponse; +mod v2_list_execution_services_response; +pub use self::v2_list_execution_services_response::V2ListExecutionServicesResponse; +mod v2_list_executions_response; +pub use self::v2_list_executions_response::V2ListExecutionsResponse; +mod v2_list_targets_request; +pub use self::v2_list_targets_request::V2ListTargetsRequest; +mod v2_list_executions_request; +pub use self::v2_list_executions_request::V2ListExecutionsRequest; +mod v2_list_targets_response; +pub use self::v2_list_targets_response::V2ListTargetsResponse; +mod v2_pagination_request; +pub use self::v2_pagination_request::V2PaginationRequest; +mod v2_pagination_response; +pub use self::v2_pagination_response::V2PaginationResponse; +mod v2_request_execution; +pub use self::v2_request_execution::V2RequestExecution; +mod v2_response_execution; +pub use self::v2_response_execution::V2ResponseExecution; +mod v2_rest_async; +pub use self::v2_rest_async::V2RestAsync; +mod v2_rest_call; +pub use self::v2_rest_call::V2RestCall; +mod v2_rest_webhook; +pub use self::v2_rest_webhook::V2RestWebhook; +mod v2_set_execution_request; +pub use self::v2_set_execution_request::V2SetExecutionRequest; +mod v2_set_execution_response; +pub use self::v2_set_execution_response::V2SetExecutionResponse; +mod v2_target; +pub use self::v2_target::V2Target; +mod v2_target_field_name; +pub use self::v2_target_field_name::V2TargetFieldName; +mod v2_target_filter; +pub use self::v2_target_filter::V2TargetFilter; +mod v2_target_name_filter; +pub use self::v2_target_name_filter::V2TargetNameFilter; +mod v2_target_search_filter; +pub use self::v2_target_search_filter::V2TargetSearchFilter; +mod v2_text_filter_method; +pub use self::v2_text_filter_method::V2TextFilterMethod; +mod v2_update_target_response; +pub use self::v2_update_target_response::V2UpdateTargetResponse; +mod v2_payload_type; +pub use self::v2_payload_type::V2PayloadType; diff --git a/src/v2/actions/models/v2beta_condition.rs b/src/v2/actions/models/v2_condition.rs similarity index 57% rename from src/v2/actions/models/v2beta_condition.rs rename to src/v2/actions/models/v2_condition.rs index 73254bee..207c09ac 100644 --- a/src/v2/actions/models/v2beta_condition.rs +++ b/src/v2/actions/models/v2_condition.rs @@ -19,37 +19,37 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaCondition { +pub struct V2Condition { /// Condition-type to execute if a request on the defined API point happens. #[serde(rename = "request")] - request: Option, + request: Option, /// Condition-type to execute on response if a request on the defined API /// point happens. #[serde(rename = "response")] - response: Option, + response: Option, /// Condition-type to execute if function is used, replaces actions v1. #[serde(rename = "function")] - function: Option, + function: Option, /// Condition-type to execute if an event is created in the system. #[serde(rename = "event")] - event: Option, + event: Option, } -impl V2betaCondition { - pub fn new() -> V2betaCondition { - V2betaCondition { request: None, response: None, function: None, event: None } +impl V2Condition { + pub fn new() -> V2Condition { + V2Condition { request: None, response: None, function: None, event: None } } - pub fn set_request(&mut self, request: super::V2betaRequestExecution) { + pub fn set_request(&mut self, request: super::V2RequestExecution) { self.request = Some(request); } - pub fn with_request(mut self, request: super::V2betaRequestExecution) -> V2betaCondition { + pub fn with_request(mut self, request: super::V2RequestExecution) -> V2Condition { self.request = Some(request); self } - pub fn request(&self) -> Option<&super::V2betaRequestExecution> { + pub fn request(&self) -> Option<&super::V2RequestExecution> { self.request.as_ref() } @@ -57,16 +57,16 @@ impl V2betaCondition { self.request = None; } - pub fn set_response(&mut self, response: super::V2betaResponseExecution) { + pub fn set_response(&mut self, response: super::V2ResponseExecution) { self.response = Some(response); } - pub fn with_response(mut self, response: super::V2betaResponseExecution) -> V2betaCondition { + pub fn with_response(mut self, response: super::V2ResponseExecution) -> V2Condition { self.response = Some(response); self } - pub fn response(&self) -> Option<&super::V2betaResponseExecution> { + pub fn response(&self) -> Option<&super::V2ResponseExecution> { self.response.as_ref() } @@ -74,16 +74,16 @@ impl V2betaCondition { self.response = None; } - pub fn set_function(&mut self, function: super::V2betaFunctionExecution) { + pub fn set_function(&mut self, function: super::V2FunctionExecution) { self.function = Some(function); } - pub fn with_function(mut self, function: super::V2betaFunctionExecution) -> V2betaCondition { + pub fn with_function(mut self, function: super::V2FunctionExecution) -> V2Condition { self.function = Some(function); self } - pub fn function(&self) -> Option<&super::V2betaFunctionExecution> { + pub fn function(&self) -> Option<&super::V2FunctionExecution> { self.function.as_ref() } @@ -91,16 +91,16 @@ impl V2betaCondition { self.function = None; } - pub fn set_event(&mut self, event: super::V2betaEventExecution) { + pub fn set_event(&mut self, event: super::V2EventExecution) { self.event = Some(event); } - pub fn with_event(mut self, event: super::V2betaEventExecution) -> V2betaCondition { + pub fn with_event(mut self, event: super::V2EventExecution) -> V2Condition { self.event = Some(event); self } - pub fn event(&self) -> Option<&super::V2betaEventExecution> { + pub fn event(&self) -> Option<&super::V2EventExecution> { self.event.as_ref() } diff --git a/src/v2/actions/models/v2beta_create_target_request.rs b/src/v2/actions/models/v2_create_target_request.rs similarity index 62% rename from src/v2/actions/models/v2beta_create_target_request.rs rename to src/v2/actions/models/v2_create_target_request.rs index d7bad056..09a3f55e 100644 --- a/src/v2/actions/models/v2beta_create_target_request.rs +++ b/src/v2/actions/models/v2_create_target_request.rs @@ -19,21 +19,21 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaCreateTargetRequest { +pub struct V2CreateTargetRequest { #[serde(rename = "name")] name: Option, /// Wait for response but response body is ignored, status is checked, call /// is sent as post. #[serde(rename = "restWebhook")] - rest_webhook: Option, + rest_webhook: Option, /// Wait for response and response body is used, status is checked, call is /// sent as post. #[serde(rename = "restCall")] - rest_call: Option, + rest_call: Option, /// Call is executed in parallel to others, ZITADEL does not wait until the /// call is finished. The state is ignored, call is sent as post. #[serde(rename = "restAsync")] - rest_async: Option, + rest_async: Option, /// Timeout defines the duration until ZITADEL cancels the execution. If the /// target doesn't respond before this timeout expires, then the connection /// is closed and the action fails. Depending on the target type and @@ -44,25 +44,51 @@ pub struct V2betaCreateTargetRequest { timeout: Option, #[serde(rename = "endpoint")] endpoint: Option, + /// How the payload is formatted and secured when sent to the target. + /// Defaults to `PAYLOAD_TYPE_JSON` (plain JSON with a signature header). + /// Use `PAYLOAD_TYPE_JWT` for a signed JWT body. + #[serde(rename = "payloadType", skip_serializing_if = "Option::is_none")] + payload_type: Option, } -impl V2betaCreateTargetRequest { - pub fn new() -> V2betaCreateTargetRequest { - V2betaCreateTargetRequest { +impl V2CreateTargetRequest { + pub fn new() -> V2CreateTargetRequest { + V2CreateTargetRequest { name: None, rest_webhook: None, rest_call: None, rest_async: None, timeout: None, endpoint: None, + payload_type: None, } } + pub fn set_payload_type(&mut self, payload_type: super::V2PayloadType) { + self.payload_type = Some(payload_type); + } + + pub fn with_payload_type( + mut self, + payload_type: super::V2PayloadType, + ) -> V2CreateTargetRequest { + self.payload_type = Some(payload_type); + self + } + + pub fn payload_type(&self) -> Option<&super::V2PayloadType> { + self.payload_type.as_ref() + } + + pub fn reset_payload_type(&mut self) { + self.payload_type = None; + } + pub fn set_name(&mut self, name: String) { self.name = Some(name); } - pub fn with_name(mut self, name: String) -> V2betaCreateTargetRequest { + pub fn with_name(mut self, name: String) -> V2CreateTargetRequest { self.name = Some(name); self } @@ -75,19 +101,19 @@ impl V2betaCreateTargetRequest { self.name = None; } - pub fn set_rest_webhook(&mut self, rest_webhook: super::V2betaRestWebhook) { + pub fn set_rest_webhook(&mut self, rest_webhook: super::V2RestWebhook) { self.rest_webhook = Some(rest_webhook); } pub fn with_rest_webhook( mut self, - rest_webhook: super::V2betaRestWebhook, - ) -> V2betaCreateTargetRequest { + rest_webhook: super::V2RestWebhook, + ) -> V2CreateTargetRequest { self.rest_webhook = Some(rest_webhook); self } - pub fn rest_webhook(&self) -> Option<&super::V2betaRestWebhook> { + pub fn rest_webhook(&self) -> Option<&super::V2RestWebhook> { self.rest_webhook.as_ref() } @@ -95,16 +121,16 @@ impl V2betaCreateTargetRequest { self.rest_webhook = None; } - pub fn set_rest_call(&mut self, rest_call: super::V2betaRestCall) { + pub fn set_rest_call(&mut self, rest_call: super::V2RestCall) { self.rest_call = Some(rest_call); } - pub fn with_rest_call(mut self, rest_call: super::V2betaRestCall) -> V2betaCreateTargetRequest { + pub fn with_rest_call(mut self, rest_call: super::V2RestCall) -> V2CreateTargetRequest { self.rest_call = Some(rest_call); self } - pub fn rest_call(&self) -> Option<&super::V2betaRestCall> { + pub fn rest_call(&self) -> Option<&super::V2RestCall> { self.rest_call.as_ref() } @@ -112,19 +138,16 @@ impl V2betaCreateTargetRequest { self.rest_call = None; } - pub fn set_rest_async(&mut self, rest_async: super::V2betaRestAsync) { + pub fn set_rest_async(&mut self, rest_async: super::V2RestAsync) { self.rest_async = Some(rest_async); } - pub fn with_rest_async( - mut self, - rest_async: super::V2betaRestAsync, - ) -> V2betaCreateTargetRequest { + pub fn with_rest_async(mut self, rest_async: super::V2RestAsync) -> V2CreateTargetRequest { self.rest_async = Some(rest_async); self } - pub fn rest_async(&self) -> Option<&super::V2betaRestAsync> { + pub fn rest_async(&self) -> Option<&super::V2RestAsync> { self.rest_async.as_ref() } @@ -136,7 +159,7 @@ impl V2betaCreateTargetRequest { self.timeout = Some(timeout); } - pub fn with_timeout(mut self, timeout: String) -> V2betaCreateTargetRequest { + pub fn with_timeout(mut self, timeout: String) -> V2CreateTargetRequest { self.timeout = Some(timeout); self } @@ -153,7 +176,7 @@ impl V2betaCreateTargetRequest { self.endpoint = Some(endpoint); } - pub fn with_endpoint(mut self, endpoint: String) -> V2betaCreateTargetRequest { + pub fn with_endpoint(mut self, endpoint: String) -> V2CreateTargetRequest { self.endpoint = Some(endpoint); self } diff --git a/src/v2/actions/models/v2beta_create_target_response.rs b/src/v2/actions/models/v2_create_target_response.rs similarity index 82% rename from src/v2/actions/models/v2beta_create_target_response.rs rename to src/v2/actions/models/v2_create_target_response.rs index 81550060..cde793d8 100644 --- a/src/v2/actions/models/v2beta_create_target_response.rs +++ b/src/v2/actions/models/v2_create_target_response.rs @@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaCreateTargetResponse { +pub struct V2CreateTargetResponse { /// The unique identifier of the newly created target. #[serde(rename = "id")] id: Option, @@ -31,16 +31,16 @@ pub struct V2betaCreateTargetResponse { signing_key: Option, } -impl V2betaCreateTargetResponse { - pub fn new() -> V2betaCreateTargetResponse { - V2betaCreateTargetResponse { id: None, creation_date: None, signing_key: None } +impl V2CreateTargetResponse { + pub fn new() -> V2CreateTargetResponse { + V2CreateTargetResponse { id: None, creation_date: None, signing_key: None } } pub fn set_id(&mut self, id: String) { self.id = Some(id); } - pub fn with_id(mut self, id: String) -> V2betaCreateTargetResponse { + pub fn with_id(mut self, id: String) -> V2CreateTargetResponse { self.id = Some(id); self } @@ -57,7 +57,7 @@ impl V2betaCreateTargetResponse { self.creation_date = Some(creation_date); } - pub fn with_creation_date(mut self, creation_date: String) -> V2betaCreateTargetResponse { + pub fn with_creation_date(mut self, creation_date: String) -> V2CreateTargetResponse { self.creation_date = Some(creation_date); self } @@ -74,7 +74,7 @@ impl V2betaCreateTargetResponse { self.signing_key = Some(signing_key); } - pub fn with_signing_key(mut self, signing_key: String) -> V2betaCreateTargetResponse { + pub fn with_signing_key(mut self, signing_key: String) -> V2CreateTargetResponse { self.signing_key = Some(signing_key); self } diff --git a/src/v2/actions/models/v2beta_delete_target_response.rs b/src/v2/actions/models/v2_delete_target_response.rs similarity index 86% rename from src/v2/actions/models/v2beta_delete_target_response.rs rename to src/v2/actions/models/v2_delete_target_response.rs index b9d02c46..72e7c254 100644 --- a/src/v2/actions/models/v2beta_delete_target_response.rs +++ b/src/v2/actions/models/v2_delete_target_response.rs @@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaDeleteTargetResponse { +pub struct V2DeleteTargetResponse { /// The timestamp of the deletion of the target. Note that the deletion date /// is only guaranteed to be set if the deletion was successful during the /// request. In case the deletion occurred in a previous request, the @@ -28,16 +28,16 @@ pub struct V2betaDeleteTargetResponse { deletion_date: Option, } -impl V2betaDeleteTargetResponse { - pub fn new() -> V2betaDeleteTargetResponse { - V2betaDeleteTargetResponse { deletion_date: None } +impl V2DeleteTargetResponse { + pub fn new() -> V2DeleteTargetResponse { + V2DeleteTargetResponse { deletion_date: None } } pub fn set_deletion_date(&mut self, deletion_date: String) { self.deletion_date = Some(deletion_date); } - pub fn with_deletion_date(mut self, deletion_date: String) -> V2betaDeleteTargetResponse { + pub fn with_deletion_date(mut self, deletion_date: String) -> V2DeleteTargetResponse { self.deletion_date = Some(deletion_date); self } diff --git a/src/v2/actions/models/v2beta_event_execution.rs b/src/v2/actions/models/v2_event_execution.rs similarity index 81% rename from src/v2/actions/models/v2beta_event_execution.rs rename to src/v2/actions/models/v2_event_execution.rs index bc4413bb..f32352f5 100644 --- a/src/v2/actions/models/v2beta_event_execution.rs +++ b/src/v2/actions/models/v2_event_execution.rs @@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaEventExecution { +pub struct V2EventExecution { /// Event name as condition. #[serde(rename = "event")] event: Option, @@ -31,16 +31,16 @@ pub struct V2betaEventExecution { all: Option, } -impl V2betaEventExecution { - pub fn new() -> V2betaEventExecution { - V2betaEventExecution { event: None, group: None, all: None } +impl V2EventExecution { + pub fn new() -> V2EventExecution { + V2EventExecution { event: None, group: None, all: None } } pub fn set_event(&mut self, event: String) { self.event = Some(event); } - pub fn with_event(mut self, event: String) -> V2betaEventExecution { + pub fn with_event(mut self, event: String) -> V2EventExecution { self.event = Some(event); self } @@ -57,7 +57,7 @@ impl V2betaEventExecution { self.group = Some(group); } - pub fn with_group(mut self, group: String) -> V2betaEventExecution { + pub fn with_group(mut self, group: String) -> V2EventExecution { self.group = Some(group); self } @@ -74,7 +74,7 @@ impl V2betaEventExecution { self.all = Some(all); } - pub fn with_all(mut self, all: bool) -> V2betaEventExecution { + pub fn with_all(mut self, all: bool) -> V2EventExecution { self.all = Some(all); self } diff --git a/src/v2/actions/models/v2beta_execution.rs b/src/v2/actions/models/v2_execution.rs similarity index 77% rename from src/v2/actions/models/v2beta_execution.rs rename to src/v2/actions/models/v2_execution.rs index 33a5f1bc..fcace593 100644 --- a/src/v2/actions/models/v2beta_execution.rs +++ b/src/v2/actions/models/v2_execution.rs @@ -19,9 +19,9 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaExecution { +pub struct V2Execution { #[serde(rename = "condition")] - condition: Option, + condition: Option, /// The timestamp of the execution creation. #[serde(rename = "creationDate")] creation_date: Option, @@ -33,21 +33,21 @@ pub struct V2betaExecution { targets: Option>, } -impl V2betaExecution { - pub fn new() -> V2betaExecution { - V2betaExecution { condition: None, creation_date: None, change_date: None, targets: None } +impl V2Execution { + pub fn new() -> V2Execution { + V2Execution { condition: None, creation_date: None, change_date: None, targets: None } } - pub fn set_condition(&mut self, condition: super::V2betaCondition) { + pub fn set_condition(&mut self, condition: super::V2Condition) { self.condition = Some(condition); } - pub fn with_condition(mut self, condition: super::V2betaCondition) -> V2betaExecution { + pub fn with_condition(mut self, condition: super::V2Condition) -> V2Execution { self.condition = Some(condition); self } - pub fn condition(&self) -> Option<&super::V2betaCondition> { + pub fn condition(&self) -> Option<&super::V2Condition> { self.condition.as_ref() } @@ -59,7 +59,7 @@ impl V2betaExecution { self.creation_date = Some(creation_date); } - pub fn with_creation_date(mut self, creation_date: String) -> V2betaExecution { + pub fn with_creation_date(mut self, creation_date: String) -> V2Execution { self.creation_date = Some(creation_date); self } @@ -76,7 +76,7 @@ impl V2betaExecution { self.change_date = Some(change_date); } - pub fn with_change_date(mut self, change_date: String) -> V2betaExecution { + pub fn with_change_date(mut self, change_date: String) -> V2Execution { self.change_date = Some(change_date); self } @@ -93,7 +93,7 @@ impl V2betaExecution { self.targets = Some(targets); } - pub fn with_targets(mut self, targets: Vec) -> V2betaExecution { + pub fn with_targets(mut self, targets: Vec) -> V2Execution { self.targets = Some(targets); self } diff --git a/src/v2/actions/models/v2beta_execution_field_name.rs b/src/v2/actions/models/v2_execution_field_name.rs similarity index 82% rename from src/v2/actions/models/v2beta_execution_field_name.rs rename to src/v2/actions/models/v2_execution_field_name.rs index 36147118..a67b091b 100644 --- a/src/v2/actions/models/v2beta_execution_field_name.rs +++ b/src/v2/actions/models/v2_execution_field_name.rs @@ -19,11 +19,11 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaExecutionFieldName {} +pub struct V2ExecutionFieldName {} -impl V2betaExecutionFieldName { - pub fn new() -> V2betaExecutionFieldName { - V2betaExecutionFieldName {} +impl V2ExecutionFieldName { + pub fn new() -> V2ExecutionFieldName { + V2ExecutionFieldName {} } } diff --git a/src/v2/actions/models/v2beta_execution_search_filter.rs b/src/v2/actions/models/v2_execution_search_filter.rs similarity index 61% rename from src/v2/actions/models/v2beta_execution_search_filter.rs rename to src/v2/actions/models/v2_execution_search_filter.rs index f0216036..b3e8698e 100644 --- a/src/v2/actions/models/v2beta_execution_search_filter.rs +++ b/src/v2/actions/models/v2_execution_search_filter.rs @@ -19,40 +19,37 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaExecutionSearchFilter { +pub struct V2ExecutionSearchFilter { #[serde(rename = "inConditionsFilter")] - in_conditions_filter: Option, + in_conditions_filter: Option, #[serde(rename = "executionTypeFilter")] - execution_type_filter: Option, + execution_type_filter: Option, #[serde(rename = "targetFilter")] - target_filter: Option, + target_filter: Option, } -impl V2betaExecutionSearchFilter { - pub fn new() -> V2betaExecutionSearchFilter { - V2betaExecutionSearchFilter { +impl V2ExecutionSearchFilter { + pub fn new() -> V2ExecutionSearchFilter { + V2ExecutionSearchFilter { in_conditions_filter: None, execution_type_filter: None, target_filter: None, } } - pub fn set_in_conditions_filter( - &mut self, - in_conditions_filter: super::V2betaInConditionsFilter, - ) { + pub fn set_in_conditions_filter(&mut self, in_conditions_filter: super::V2InConditionsFilter) { self.in_conditions_filter = Some(in_conditions_filter); } pub fn with_in_conditions_filter( mut self, - in_conditions_filter: super::V2betaInConditionsFilter, - ) -> V2betaExecutionSearchFilter { + in_conditions_filter: super::V2InConditionsFilter, + ) -> V2ExecutionSearchFilter { self.in_conditions_filter = Some(in_conditions_filter); self } - pub fn in_conditions_filter(&self) -> Option<&super::V2betaInConditionsFilter> { + pub fn in_conditions_filter(&self) -> Option<&super::V2InConditionsFilter> { self.in_conditions_filter.as_ref() } @@ -62,20 +59,20 @@ impl V2betaExecutionSearchFilter { pub fn set_execution_type_filter( &mut self, - execution_type_filter: super::V2betaExecutionTypeFilter, + execution_type_filter: super::V2ExecutionTypeFilter, ) { self.execution_type_filter = Some(execution_type_filter); } pub fn with_execution_type_filter( mut self, - execution_type_filter: super::V2betaExecutionTypeFilter, - ) -> V2betaExecutionSearchFilter { + execution_type_filter: super::V2ExecutionTypeFilter, + ) -> V2ExecutionSearchFilter { self.execution_type_filter = Some(execution_type_filter); self } - pub fn execution_type_filter(&self) -> Option<&super::V2betaExecutionTypeFilter> { + pub fn execution_type_filter(&self) -> Option<&super::V2ExecutionTypeFilter> { self.execution_type_filter.as_ref() } @@ -83,19 +80,19 @@ impl V2betaExecutionSearchFilter { self.execution_type_filter = None; } - pub fn set_target_filter(&mut self, target_filter: super::V2betaTargetFilter) { + pub fn set_target_filter(&mut self, target_filter: super::V2TargetFilter) { self.target_filter = Some(target_filter); } pub fn with_target_filter( mut self, - target_filter: super::V2betaTargetFilter, - ) -> V2betaExecutionSearchFilter { + target_filter: super::V2TargetFilter, + ) -> V2ExecutionSearchFilter { self.target_filter = Some(target_filter); self } - pub fn target_filter(&self) -> Option<&super::V2betaTargetFilter> { + pub fn target_filter(&self) -> Option<&super::V2TargetFilter> { self.target_filter.as_ref() } diff --git a/src/v2/actions/models/v2beta_execution_type.rs b/src/v2/actions/models/v2_execution_type.rs similarity index 84% rename from src/v2/actions/models/v2beta_execution_type.rs rename to src/v2/actions/models/v2_execution_type.rs index 8f2970f0..6955420c 100644 --- a/src/v2/actions/models/v2beta_execution_type.rs +++ b/src/v2/actions/models/v2_execution_type.rs @@ -19,11 +19,11 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaExecutionType {} +pub struct V2ExecutionType {} -impl V2betaExecutionType { - pub fn new() -> V2betaExecutionType { - V2betaExecutionType {} +impl V2ExecutionType { + pub fn new() -> V2ExecutionType { + V2ExecutionType {} } } diff --git a/src/v2/actions/models/v2beta_execution_type_filter.rs b/src/v2/actions/models/v2_execution_type_filter.rs similarity index 67% rename from src/v2/actions/models/v2beta_execution_type_filter.rs rename to src/v2/actions/models/v2_execution_type_filter.rs index fa8fc24b..d2b8841f 100644 --- a/src/v2/actions/models/v2beta_execution_type_filter.rs +++ b/src/v2/actions/models/v2_execution_type_filter.rs @@ -19,30 +19,30 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaExecutionTypeFilter { +pub struct V2ExecutionTypeFilter { /// Defines the type to query for. #[serde(rename = "executionType")] - execution_type: Option, + execution_type: Option, } -impl V2betaExecutionTypeFilter { - pub fn new() -> V2betaExecutionTypeFilter { - V2betaExecutionTypeFilter { execution_type: None } +impl V2ExecutionTypeFilter { + pub fn new() -> V2ExecutionTypeFilter { + V2ExecutionTypeFilter { execution_type: None } } - pub fn set_execution_type(&mut self, execution_type: super::V2betaExecutionType) { + pub fn set_execution_type(&mut self, execution_type: super::V2ExecutionType) { self.execution_type = Some(execution_type); } pub fn with_execution_type( mut self, - execution_type: super::V2betaExecutionType, - ) -> V2betaExecutionTypeFilter { + execution_type: super::V2ExecutionType, + ) -> V2ExecutionTypeFilter { self.execution_type = Some(execution_type); self } - pub fn execution_type(&self) -> Option<&super::V2betaExecutionType> { + pub fn execution_type(&self) -> Option<&super::V2ExecutionType> { self.execution_type.as_ref() } diff --git a/src/v2/actions/models/v2beta_function_execution.rs b/src/v2/actions/models/v2_function_execution.rs similarity index 80% rename from src/v2/actions/models/v2beta_function_execution.rs rename to src/v2/actions/models/v2_function_execution.rs index f122e641..41846099 100644 --- a/src/v2/actions/models/v2beta_function_execution.rs +++ b/src/v2/actions/models/v2_function_execution.rs @@ -19,21 +19,21 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaFunctionExecution { +pub struct V2FunctionExecution { #[serde(rename = "name")] name: Option, } -impl V2betaFunctionExecution { - pub fn new() -> V2betaFunctionExecution { - V2betaFunctionExecution { name: None } +impl V2FunctionExecution { + pub fn new() -> V2FunctionExecution { + V2FunctionExecution { name: None } } pub fn set_name(&mut self, name: String) { self.name = Some(name); } - pub fn with_name(mut self, name: String) -> V2betaFunctionExecution { + pub fn with_name(mut self, name: String) -> V2FunctionExecution { self.name = Some(name); self } diff --git a/src/v2/actions/models/v2beta_get_target_response.rs b/src/v2/actions/models/v2_get_target_response.rs similarity index 67% rename from src/v2/actions/models/v2beta_get_target_response.rs rename to src/v2/actions/models/v2_get_target_response.rs index c4de6057..146c1ac1 100644 --- a/src/v2/actions/models/v2beta_get_target_response.rs +++ b/src/v2/actions/models/v2_get_target_response.rs @@ -19,26 +19,26 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaGetTargetResponse { +pub struct V2GetTargetResponse { #[serde(rename = "target")] - target: Option, + target: Option, } -impl V2betaGetTargetResponse { - pub fn new() -> V2betaGetTargetResponse { - V2betaGetTargetResponse { target: None } +impl V2GetTargetResponse { + pub fn new() -> V2GetTargetResponse { + V2GetTargetResponse { target: None } } - pub fn set_target(&mut self, target: super::V2betaTarget) { + pub fn set_target(&mut self, target: super::V2Target) { self.target = Some(target); } - pub fn with_target(mut self, target: super::V2betaTarget) -> V2betaGetTargetResponse { + pub fn with_target(mut self, target: super::V2Target) -> V2GetTargetResponse { self.target = Some(target); self } - pub fn target(&self) -> Option<&super::V2betaTarget> { + pub fn target(&self) -> Option<&super::V2Target> { self.target.as_ref() } diff --git a/src/v2/actions/models/v2beta_in_conditions_filter.rs b/src/v2/actions/models/v2_in_conditions_filter.rs similarity index 65% rename from src/v2/actions/models/v2beta_in_conditions_filter.rs rename to src/v2/actions/models/v2_in_conditions_filter.rs index 465d9e28..1a4de7d3 100644 --- a/src/v2/actions/models/v2beta_in_conditions_filter.rs +++ b/src/v2/actions/models/v2_in_conditions_filter.rs @@ -19,30 +19,27 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaInConditionsFilter { +pub struct V2InConditionsFilter { /// Defines the conditions to query for. #[serde(rename = "conditions")] - conditions: Option>, + conditions: Option>, } -impl V2betaInConditionsFilter { - pub fn new() -> V2betaInConditionsFilter { - V2betaInConditionsFilter { conditions: None } +impl V2InConditionsFilter { + pub fn new() -> V2InConditionsFilter { + V2InConditionsFilter { conditions: None } } - pub fn set_conditions(&mut self, conditions: Vec) { + pub fn set_conditions(&mut self, conditions: Vec) { self.conditions = Some(conditions); } - pub fn with_conditions( - mut self, - conditions: Vec, - ) -> V2betaInConditionsFilter { + pub fn with_conditions(mut self, conditions: Vec) -> V2InConditionsFilter { self.conditions = Some(conditions); self } - pub fn conditions(&self) -> Option<&Vec> { + pub fn conditions(&self) -> Option<&Vec> { self.conditions.as_ref() } diff --git a/src/v2/actions/models/v2beta_in_target_ids_filter.rs b/src/v2/actions/models/v2_in_target_ids_filter.rs similarity index 85% rename from src/v2/actions/models/v2beta_in_target_ids_filter.rs rename to src/v2/actions/models/v2_in_target_ids_filter.rs index 5e505d08..9021411a 100644 --- a/src/v2/actions/models/v2beta_in_target_ids_filter.rs +++ b/src/v2/actions/models/v2_in_target_ids_filter.rs @@ -19,22 +19,22 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaInTargetIdsFilter { +pub struct V2InTargetIdsFilter { /// the ids of the targets to include #[serde(rename = "targetIds")] target_ids: Option>, } -impl V2betaInTargetIdsFilter { - pub fn new() -> V2betaInTargetIdsFilter { - V2betaInTargetIdsFilter { target_ids: None } +impl V2InTargetIdsFilter { + pub fn new() -> V2InTargetIdsFilter { + V2InTargetIdsFilter { target_ids: None } } pub fn set_target_ids(&mut self, target_ids: Vec) { self.target_ids = Some(target_ids); } - pub fn with_target_ids(mut self, target_ids: Vec) -> V2betaInTargetIdsFilter { + pub fn with_target_ids(mut self, target_ids: Vec) -> V2InTargetIdsFilter { self.target_ids = Some(target_ids); self } diff --git a/src/v2/actions/models/v2beta_list_execution_functions_response.rs b/src/v2/actions/models/v2_list_execution_functions_response.rs similarity index 75% rename from src/v2/actions/models/v2beta_list_execution_functions_response.rs rename to src/v2/actions/models/v2_list_execution_functions_response.rs index 024c9298..8ae27e5d 100644 --- a/src/v2/actions/models/v2beta_list_execution_functions_response.rs +++ b/src/v2/actions/models/v2_list_execution_functions_response.rs @@ -19,24 +19,21 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaListExecutionFunctionsResponse { +pub struct V2ListExecutionFunctionsResponse { #[serde(rename = "functions")] functions: Option>, } -impl V2betaListExecutionFunctionsResponse { - pub fn new() -> V2betaListExecutionFunctionsResponse { - V2betaListExecutionFunctionsResponse { functions: None } +impl V2ListExecutionFunctionsResponse { + pub fn new() -> V2ListExecutionFunctionsResponse { + V2ListExecutionFunctionsResponse { functions: None } } pub fn set_functions(&mut self, functions: Vec) { self.functions = Some(functions); } - pub fn with_functions( - mut self, - functions: Vec, - ) -> V2betaListExecutionFunctionsResponse { + pub fn with_functions(mut self, functions: Vec) -> V2ListExecutionFunctionsResponse { self.functions = Some(functions); self } diff --git a/src/v2/actions/models/v2beta_list_execution_methods_response.rs b/src/v2/actions/models/v2_list_execution_methods_response.rs similarity index 76% rename from src/v2/actions/models/v2beta_list_execution_methods_response.rs rename to src/v2/actions/models/v2_list_execution_methods_response.rs index 4db341b6..d254cd1b 100644 --- a/src/v2/actions/models/v2beta_list_execution_methods_response.rs +++ b/src/v2/actions/models/v2_list_execution_methods_response.rs @@ -19,21 +19,21 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaListExecutionMethodsResponse { +pub struct V2ListExecutionMethodsResponse { #[serde(rename = "methods")] methods: Option>, } -impl V2betaListExecutionMethodsResponse { - pub fn new() -> V2betaListExecutionMethodsResponse { - V2betaListExecutionMethodsResponse { methods: None } +impl V2ListExecutionMethodsResponse { + pub fn new() -> V2ListExecutionMethodsResponse { + V2ListExecutionMethodsResponse { methods: None } } pub fn set_methods(&mut self, methods: Vec) { self.methods = Some(methods); } - pub fn with_methods(mut self, methods: Vec) -> V2betaListExecutionMethodsResponse { + pub fn with_methods(mut self, methods: Vec) -> V2ListExecutionMethodsResponse { self.methods = Some(methods); self } diff --git a/src/v2/actions/models/v2beta_list_execution_services_response.rs b/src/v2/actions/models/v2_list_execution_services_response.rs similarity index 76% rename from src/v2/actions/models/v2beta_list_execution_services_response.rs rename to src/v2/actions/models/v2_list_execution_services_response.rs index a08ffa4b..992cb49e 100644 --- a/src/v2/actions/models/v2beta_list_execution_services_response.rs +++ b/src/v2/actions/models/v2_list_execution_services_response.rs @@ -19,21 +19,21 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaListExecutionServicesResponse { +pub struct V2ListExecutionServicesResponse { #[serde(rename = "services")] services: Option>, } -impl V2betaListExecutionServicesResponse { - pub fn new() -> V2betaListExecutionServicesResponse { - V2betaListExecutionServicesResponse { services: None } +impl V2ListExecutionServicesResponse { + pub fn new() -> V2ListExecutionServicesResponse { + V2ListExecutionServicesResponse { services: None } } pub fn set_services(&mut self, services: Vec) { self.services = Some(services); } - pub fn with_services(mut self, services: Vec) -> V2betaListExecutionServicesResponse { + pub fn with_services(mut self, services: Vec) -> V2ListExecutionServicesResponse { self.services = Some(services); self } diff --git a/src/v2/actions/models/v2beta_list_targets_request.rs b/src/v2/actions/models/v2_list_executions_request.rs similarity index 63% rename from src/v2/actions/models/v2beta_list_targets_request.rs rename to src/v2/actions/models/v2_list_executions_request.rs index 9a38ec8e..3c40d562 100644 --- a/src/v2/actions/models/v2beta_list_targets_request.rs +++ b/src/v2/actions/models/v2_list_executions_request.rs @@ -19,41 +19,41 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaListTargetsRequest { +pub struct V2ListExecutionsRequest { /// List limitations and ordering. #[serde(rename = "pagination")] #[serde(skip_serializing_if = "Option::is_none")] - pagination: Option, + pagination: Option, /// The field the result is sorted by. The default is the creation date. /// Beware that if you change this, your result pagination might be /// inconsistent. #[serde(rename = "sortingColumn")] #[serde(skip_serializing_if = "Option::is_none")] - sorting_column: Option, + sorting_column: Option, /// Define the criteria to query for. #[serde(rename = "filters")] #[serde(skip_serializing_if = "Option::is_none")] - filters: Option>, + filters: Option>, } -impl V2betaListTargetsRequest { - pub fn new() -> V2betaListTargetsRequest { - V2betaListTargetsRequest { pagination: None, sorting_column: None, filters: None } +impl V2ListExecutionsRequest { + pub fn new() -> V2ListExecutionsRequest { + V2ListExecutionsRequest { pagination: None, sorting_column: None, filters: None } } - pub fn set_pagination(&mut self, pagination: super::V2betaPaginationRequest) { + pub fn set_pagination(&mut self, pagination: super::V2PaginationRequest) { self.pagination = Some(pagination); } pub fn with_pagination( mut self, - pagination: super::V2betaPaginationRequest, - ) -> V2betaListTargetsRequest { + pagination: super::V2PaginationRequest, + ) -> V2ListExecutionsRequest { self.pagination = Some(pagination); self } - pub fn pagination(&self) -> Option<&super::V2betaPaginationRequest> { + pub fn pagination(&self) -> Option<&super::V2PaginationRequest> { self.pagination.as_ref() } @@ -61,19 +61,19 @@ impl V2betaListTargetsRequest { self.pagination = None; } - pub fn set_sorting_column(&mut self, sorting_column: super::V2betaTargetFieldName) { + pub fn set_sorting_column(&mut self, sorting_column: super::V2ExecutionFieldName) { self.sorting_column = Some(sorting_column); } pub fn with_sorting_column( mut self, - sorting_column: super::V2betaTargetFieldName, - ) -> V2betaListTargetsRequest { + sorting_column: super::V2ExecutionFieldName, + ) -> V2ListExecutionsRequest { self.sorting_column = Some(sorting_column); self } - pub fn sorting_column(&self) -> Option<&super::V2betaTargetFieldName> { + pub fn sorting_column(&self) -> Option<&super::V2ExecutionFieldName> { self.sorting_column.as_ref() } @@ -81,19 +81,19 @@ impl V2betaListTargetsRequest { self.sorting_column = None; } - pub fn set_filters(&mut self, filters: Vec) { + pub fn set_filters(&mut self, filters: Vec) { self.filters = Some(filters); } pub fn with_filters( mut self, - filters: Vec, - ) -> V2betaListTargetsRequest { + filters: Vec, + ) -> V2ListExecutionsRequest { self.filters = Some(filters); self } - pub fn filters(&self) -> Option<&Vec> { + pub fn filters(&self) -> Option<&Vec> { self.filters.as_ref() } @@ -104,24 +104,24 @@ impl V2betaListTargetsRequest { use crate::v2::pagination::{PaginationParams, PaginationRequest}; -impl PaginationRequest +impl PaginationRequest for ( Option, - Option, - Option>, + Option, + Option>, ) { #[allow(clippy::cast_possible_wrap)] - fn to_paginated_request(&self, page: usize) -> V2betaListTargetsRequest { + fn to_paginated_request(&self, page: usize) -> V2ListExecutionsRequest { let params = self.0.as_ref().unwrap_or(&PaginationParams::DEFAULT); let pagination = Some( - super::V2betaPaginationRequest::new() + super::V2PaginationRequest::new() .with_limit(params.page_size as i64) .with_offset((page * params.page_size).to_string()) .with_asc(params.asc), ); - V2betaListTargetsRequest { + V2ListExecutionsRequest { pagination, sorting_column: self.1.clone(), filters: self.2.clone(), diff --git a/src/v2/actions/models/v2beta_list_executions_response.rs b/src/v2/actions/models/v2_list_executions_response.rs similarity index 60% rename from src/v2/actions/models/v2beta_list_executions_response.rs rename to src/v2/actions/models/v2_list_executions_response.rs index b8221233..5abea1da 100644 --- a/src/v2/actions/models/v2beta_list_executions_response.rs +++ b/src/v2/actions/models/v2_list_executions_response.rs @@ -19,31 +19,31 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaListExecutionsResponse { +pub struct V2ListExecutionsResponse { #[serde(rename = "pagination")] - pagination: Option, + pagination: Option, #[serde(rename = "executions")] - pub executions: Option>, + pub executions: Option>, } -impl V2betaListExecutionsResponse { - pub fn new() -> V2betaListExecutionsResponse { - V2betaListExecutionsResponse { pagination: None, executions: None } +impl V2ListExecutionsResponse { + pub fn new() -> V2ListExecutionsResponse { + V2ListExecutionsResponse { pagination: None, executions: None } } - pub fn set_pagination(&mut self, pagination: super::V2betaPaginationResponse) { + pub fn set_pagination(&mut self, pagination: super::V2PaginationResponse) { self.pagination = Some(pagination); } pub fn with_pagination( mut self, - pagination: super::V2betaPaginationResponse, - ) -> V2betaListExecutionsResponse { + pagination: super::V2PaginationResponse, + ) -> V2ListExecutionsResponse { self.pagination = Some(pagination); self } - pub fn pagination(&self) -> Option<&super::V2betaPaginationResponse> { + pub fn pagination(&self) -> Option<&super::V2PaginationResponse> { self.pagination.as_ref() } @@ -51,19 +51,19 @@ impl V2betaListExecutionsResponse { self.pagination = None; } - pub fn set_executions(&mut self, executions: Vec) { + pub fn set_executions(&mut self, executions: Vec) { self.executions = Some(executions); } pub fn with_executions( mut self, - executions: Vec, - ) -> V2betaListExecutionsResponse { + executions: Vec, + ) -> V2ListExecutionsResponse { self.executions = Some(executions); self } - pub fn executions(&self) -> Option<&Vec> { + pub fn executions(&self) -> Option<&Vec> { self.executions.as_ref() } diff --git a/src/v2/actions/models/v2beta_list_executions_request.rs b/src/v2/actions/models/v2_list_targets_request.rs similarity index 60% rename from src/v2/actions/models/v2beta_list_executions_request.rs rename to src/v2/actions/models/v2_list_targets_request.rs index a5438521..4c70a517 100644 --- a/src/v2/actions/models/v2beta_list_executions_request.rs +++ b/src/v2/actions/models/v2_list_targets_request.rs @@ -19,41 +19,41 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaListExecutionsRequest { +pub struct V2ListTargetsRequest { /// List limitations and ordering. #[serde(rename = "pagination")] #[serde(skip_serializing_if = "Option::is_none")] - pagination: Option, + pagination: Option, /// The field the result is sorted by. The default is the creation date. /// Beware that if you change this, your result pagination might be /// inconsistent. #[serde(rename = "sortingColumn")] #[serde(skip_serializing_if = "Option::is_none")] - sorting_column: Option, + sorting_column: Option, /// Define the criteria to query for. #[serde(rename = "filters")] #[serde(skip_serializing_if = "Option::is_none")] - filters: Option>, + filters: Option>, } -impl V2betaListExecutionsRequest { - pub fn new() -> V2betaListExecutionsRequest { - V2betaListExecutionsRequest { pagination: None, sorting_column: None, filters: None } +impl V2ListTargetsRequest { + pub fn new() -> V2ListTargetsRequest { + V2ListTargetsRequest { pagination: None, sorting_column: None, filters: None } } - pub fn set_pagination(&mut self, pagination: super::V2betaPaginationRequest) { + pub fn set_pagination(&mut self, pagination: super::V2PaginationRequest) { self.pagination = Some(pagination); } pub fn with_pagination( mut self, - pagination: super::V2betaPaginationRequest, - ) -> V2betaListExecutionsRequest { + pagination: super::V2PaginationRequest, + ) -> V2ListTargetsRequest { self.pagination = Some(pagination); self } - pub fn pagination(&self) -> Option<&super::V2betaPaginationRequest> { + pub fn pagination(&self) -> Option<&super::V2PaginationRequest> { self.pagination.as_ref() } @@ -61,19 +61,19 @@ impl V2betaListExecutionsRequest { self.pagination = None; } - pub fn set_sorting_column(&mut self, sorting_column: super::V2betaExecutionFieldName) { + pub fn set_sorting_column(&mut self, sorting_column: super::V2TargetFieldName) { self.sorting_column = Some(sorting_column); } pub fn with_sorting_column( mut self, - sorting_column: super::V2betaExecutionFieldName, - ) -> V2betaListExecutionsRequest { + sorting_column: super::V2TargetFieldName, + ) -> V2ListTargetsRequest { self.sorting_column = Some(sorting_column); self } - pub fn sorting_column(&self) -> Option<&super::V2betaExecutionFieldName> { + pub fn sorting_column(&self) -> Option<&super::V2TargetFieldName> { self.sorting_column.as_ref() } @@ -81,19 +81,19 @@ impl V2betaListExecutionsRequest { self.sorting_column = None; } - pub fn set_filters(&mut self, filters: Vec) { + pub fn set_filters(&mut self, filters: Vec) { self.filters = Some(filters); } pub fn with_filters( mut self, - filters: Vec, - ) -> V2betaListExecutionsRequest { + filters: Vec, + ) -> V2ListTargetsRequest { self.filters = Some(filters); self } - pub fn filters(&self) -> Option<&Vec> { + pub fn filters(&self) -> Option<&Vec> { self.filters.as_ref() } @@ -104,28 +104,24 @@ impl V2betaListExecutionsRequest { use crate::v2::pagination::{PaginationParams, PaginationRequest}; -impl PaginationRequest +impl PaginationRequest for ( Option, - Option, - Option>, + Option, + Option>, ) { #[allow(clippy::cast_possible_wrap)] - fn to_paginated_request(&self, page: usize) -> V2betaListExecutionsRequest { + fn to_paginated_request(&self, page: usize) -> V2ListTargetsRequest { let params = self.0.as_ref().unwrap_or(&PaginationParams::DEFAULT); let pagination = Some( - super::V2betaPaginationRequest::new() + super::V2PaginationRequest::new() .with_limit(params.page_size as i64) .with_offset((page * params.page_size).to_string()) .with_asc(params.asc), ); - V2betaListExecutionsRequest { - pagination, - sorting_column: self.1.clone(), - filters: self.2.clone(), - } + V2ListTargetsRequest { pagination, sorting_column: self.1.clone(), filters: self.2.clone() } } fn page_size(&self) -> usize { diff --git a/src/v2/actions/models/v2beta_list_targets_response.rs b/src/v2/actions/models/v2_list_targets_response.rs similarity index 59% rename from src/v2/actions/models/v2beta_list_targets_response.rs rename to src/v2/actions/models/v2_list_targets_response.rs index 0892db0a..ec08e920 100644 --- a/src/v2/actions/models/v2beta_list_targets_response.rs +++ b/src/v2/actions/models/v2_list_targets_response.rs @@ -19,31 +19,31 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaListTargetsResponse { +pub struct V2ListTargetsResponse { #[serde(rename = "pagination")] - pagination: Option, + pagination: Option, #[serde(rename = "result")] - result: Option>, + result: Option>, } -impl V2betaListTargetsResponse { - pub fn new() -> V2betaListTargetsResponse { - V2betaListTargetsResponse { pagination: None, result: None } +impl V2ListTargetsResponse { + pub fn new() -> V2ListTargetsResponse { + V2ListTargetsResponse { pagination: None, result: None } } - pub fn set_pagination(&mut self, pagination: super::V2betaPaginationResponse) { + pub fn set_pagination(&mut self, pagination: super::V2PaginationResponse) { self.pagination = Some(pagination); } pub fn with_pagination( mut self, - pagination: super::V2betaPaginationResponse, - ) -> V2betaListTargetsResponse { + pagination: super::V2PaginationResponse, + ) -> V2ListTargetsResponse { self.pagination = Some(pagination); self } - pub fn pagination(&self) -> Option<&super::V2betaPaginationResponse> { + pub fn pagination(&self) -> Option<&super::V2PaginationResponse> { self.pagination.as_ref() } @@ -51,16 +51,16 @@ impl V2betaListTargetsResponse { self.pagination = None; } - pub fn set_result(&mut self, result: Vec) { + pub fn set_result(&mut self, result: Vec) { self.result = Some(result); } - pub fn with_result(mut self, result: Vec) -> V2betaListTargetsResponse { + pub fn with_result(mut self, result: Vec) -> V2ListTargetsResponse { self.result = Some(result); self } - pub fn result(&self) -> Option<&Vec> { + pub fn result(&self) -> Option<&Vec> { self.result.as_ref() } diff --git a/src/v2/actions/models/v2beta_pagination_request.rs b/src/v2/actions/models/v2_pagination_request.rs similarity index 83% rename from src/v2/actions/models/v2beta_pagination_request.rs rename to src/v2/actions/models/v2_pagination_request.rs index efbfc186..3612d282 100644 --- a/src/v2/actions/models/v2beta_pagination_request.rs +++ b/src/v2/actions/models/v2_pagination_request.rs @@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaPaginationRequest { +pub struct V2PaginationRequest { /// Starting point for retrieval, in combination of offset used to query a /// set list of objects. #[serde(rename = "offset")] @@ -36,16 +36,16 @@ pub struct V2betaPaginationRequest { asc: Option, } -impl V2betaPaginationRequest { - pub fn new() -> V2betaPaginationRequest { - V2betaPaginationRequest { offset: None, limit: None, asc: None } +impl V2PaginationRequest { + pub fn new() -> V2PaginationRequest { + V2PaginationRequest { offset: None, limit: None, asc: None } } pub fn set_offset(&mut self, offset: String) { self.offset = Some(offset); } - pub fn with_offset(mut self, offset: String) -> V2betaPaginationRequest { + pub fn with_offset(mut self, offset: String) -> V2PaginationRequest { self.offset = Some(offset); self } @@ -62,7 +62,7 @@ impl V2betaPaginationRequest { self.limit = Some(limit); } - pub fn with_limit(mut self, limit: i64) -> V2betaPaginationRequest { + pub fn with_limit(mut self, limit: i64) -> V2PaginationRequest { self.limit = Some(limit); self } @@ -79,7 +79,7 @@ impl V2betaPaginationRequest { self.asc = Some(asc); } - pub fn with_asc(mut self, asc: bool) -> V2betaPaginationRequest { + pub fn with_asc(mut self, asc: bool) -> V2PaginationRequest { self.asc = Some(asc); self } diff --git a/src/v2/actions/models/v2beta_pagination_response.rs b/src/v2/actions/models/v2_pagination_response.rs similarity index 84% rename from src/v2/actions/models/v2beta_pagination_response.rs rename to src/v2/actions/models/v2_pagination_response.rs index da4be850..a510f2ab 100644 --- a/src/v2/actions/models/v2beta_pagination_response.rs +++ b/src/v2/actions/models/v2_pagination_response.rs @@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaPaginationResponse { +pub struct V2PaginationResponse { /// Absolute number of objects matching the query, regardless of applied /// limit. #[serde(rename = "totalResult")] @@ -30,16 +30,16 @@ pub struct V2betaPaginationResponse { applied_limit: Option, } -impl V2betaPaginationResponse { - pub fn new() -> V2betaPaginationResponse { - V2betaPaginationResponse { total_result: None, applied_limit: None } +impl V2PaginationResponse { + pub fn new() -> V2PaginationResponse { + V2PaginationResponse { total_result: None, applied_limit: None } } pub fn set_total_result(&mut self, total_result: String) { self.total_result = Some(total_result); } - pub fn with_total_result(mut self, total_result: String) -> V2betaPaginationResponse { + pub fn with_total_result(mut self, total_result: String) -> V2PaginationResponse { self.total_result = Some(total_result); self } @@ -56,7 +56,7 @@ impl V2betaPaginationResponse { self.applied_limit = Some(applied_limit); } - pub fn with_applied_limit(mut self, applied_limit: String) -> V2betaPaginationResponse { + pub fn with_applied_limit(mut self, applied_limit: String) -> V2PaginationResponse { self.applied_limit = Some(applied_limit); self } diff --git a/src/v2/actions/models/v2_payload_type.rs b/src/v2/actions/models/v2_payload_type.rs new file mode 100644 index 00000000..a6af3052 --- /dev/null +++ b/src/v2/actions/models/v2_payload_type.rs @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: 2025 Famedly GmbH (info@famedly.com) +// +// SPDX-License-Identifier: Apache-2.0 + +use serde::{Deserialize, Serialize}; + +/// Defines how the payload is formatted and secured when sent to the target. +/// +/// Corresponds to the `PayloadType` enum in the Zitadel Actions v2 API proto. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub enum V2PayloadType { + /// Sends the payload as plain JSON. A signature is included in the + /// `X-ZITADEL-Signature` request header for integrity verification. + /// This is the default for backwards compatibility. + #[serde(rename = "PAYLOAD_TYPE_JSON")] + Json, + /// Sends the payload as a signed JWT in the request body. The receiver + /// can verify authenticity and integrity using the public key published + /// at the JWKS endpoint (`/oauth/v2/keys`). + #[serde(rename = "PAYLOAD_TYPE_JWT")] + Jwt, + /// Sends the payload as an encrypted JWT (JWE). Provides confidentiality + /// in addition to authenticity. Requires uploading a public key for + /// encryption. + #[serde(rename = "PAYLOAD_TYPE_JWE")] + Jwe, +} diff --git a/src/v2/actions/models/v2beta_request_execution.rs b/src/v2/actions/models/v2_request_execution.rs similarity index 80% rename from src/v2/actions/models/v2beta_request_execution.rs rename to src/v2/actions/models/v2_request_execution.rs index d57efdf1..17c99c38 100644 --- a/src/v2/actions/models/v2beta_request_execution.rs +++ b/src/v2/actions/models/v2_request_execution.rs @@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaRequestExecution { +pub struct V2RequestExecution { /// GRPC-method as condition. #[serde(rename = "method")] method: Option, @@ -31,16 +31,16 @@ pub struct V2betaRequestExecution { all: Option, } -impl V2betaRequestExecution { - pub fn new() -> V2betaRequestExecution { - V2betaRequestExecution { method: None, service: None, all: None } +impl V2RequestExecution { + pub fn new() -> V2RequestExecution { + V2RequestExecution { method: None, service: None, all: None } } pub fn set_method(&mut self, method: String) { self.method = Some(method); } - pub fn with_method(mut self, method: String) -> V2betaRequestExecution { + pub fn with_method(mut self, method: String) -> V2RequestExecution { self.method = Some(method); self } @@ -57,7 +57,7 @@ impl V2betaRequestExecution { self.service = Some(service); } - pub fn with_service(mut self, service: String) -> V2betaRequestExecution { + pub fn with_service(mut self, service: String) -> V2RequestExecution { self.service = Some(service); self } @@ -74,7 +74,7 @@ impl V2betaRequestExecution { self.all = Some(all); } - pub fn with_all(mut self, all: bool) -> V2betaRequestExecution { + pub fn with_all(mut self, all: bool) -> V2RequestExecution { self.all = Some(all); self } diff --git a/src/v2/actions/models/v2beta_response_execution.rs b/src/v2/actions/models/v2_response_execution.rs similarity index 80% rename from src/v2/actions/models/v2beta_response_execution.rs rename to src/v2/actions/models/v2_response_execution.rs index c54e587b..594ef7c6 100644 --- a/src/v2/actions/models/v2beta_response_execution.rs +++ b/src/v2/actions/models/v2_response_execution.rs @@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaResponseExecution { +pub struct V2ResponseExecution { /// GRPC-method as condition. #[serde(rename = "method")] method: Option, @@ -31,16 +31,16 @@ pub struct V2betaResponseExecution { all: Option, } -impl V2betaResponseExecution { - pub fn new() -> V2betaResponseExecution { - V2betaResponseExecution { method: None, service: None, all: None } +impl V2ResponseExecution { + pub fn new() -> V2ResponseExecution { + V2ResponseExecution { method: None, service: None, all: None } } pub fn set_method(&mut self, method: String) { self.method = Some(method); } - pub fn with_method(mut self, method: String) -> V2betaResponseExecution { + pub fn with_method(mut self, method: String) -> V2ResponseExecution { self.method = Some(method); self } @@ -57,7 +57,7 @@ impl V2betaResponseExecution { self.service = Some(service); } - pub fn with_service(mut self, service: String) -> V2betaResponseExecution { + pub fn with_service(mut self, service: String) -> V2ResponseExecution { self.service = Some(service); self } @@ -74,7 +74,7 @@ impl V2betaResponseExecution { self.all = Some(all); } - pub fn with_all(mut self, all: bool) -> V2betaResponseExecution { + pub fn with_all(mut self, all: bool) -> V2ResponseExecution { self.all = Some(all); self } diff --git a/src/v2/actions/models/v2beta_rest_async.rs b/src/v2/actions/models/v2_rest_async.rs similarity index 85% rename from src/v2/actions/models/v2beta_rest_async.rs rename to src/v2/actions/models/v2_rest_async.rs index f2f438f1..24475597 100644 --- a/src/v2/actions/models/v2beta_rest_async.rs +++ b/src/v2/actions/models/v2_rest_async.rs @@ -19,10 +19,10 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaRestAsync {} +pub struct V2RestAsync {} -impl V2betaRestAsync { - pub fn new() -> V2betaRestAsync { - V2betaRestAsync {} +impl V2RestAsync { + pub fn new() -> V2RestAsync { + V2RestAsync {} } } diff --git a/src/v2/actions/models/v2beta_rest_call.rs b/src/v2/actions/models/v2_rest_call.rs similarity index 88% rename from src/v2/actions/models/v2beta_rest_call.rs rename to src/v2/actions/models/v2_rest_call.rs index 98429397..eccd51b4 100644 --- a/src/v2/actions/models/v2beta_rest_call.rs +++ b/src/v2/actions/models/v2_rest_call.rs @@ -19,23 +19,23 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaRestCall { +pub struct V2RestCall { /// Define if any error stops the whole execution. By default the process /// continues as normal. #[serde(rename = "interruptOnError")] interrupt_on_error: Option, } -impl V2betaRestCall { - pub fn new() -> V2betaRestCall { - V2betaRestCall { interrupt_on_error: None } +impl V2RestCall { + pub fn new() -> V2RestCall { + V2RestCall { interrupt_on_error: None } } pub fn set_interrupt_on_error(&mut self, interrupt_on_error: bool) { self.interrupt_on_error = Some(interrupt_on_error); } - pub fn with_interrupt_on_error(mut self, interrupt_on_error: bool) -> V2betaRestCall { + pub fn with_interrupt_on_error(mut self, interrupt_on_error: bool) -> V2RestCall { self.interrupt_on_error = Some(interrupt_on_error); self } diff --git a/src/v2/actions/models/v2beta_rest_webhook.rs b/src/v2/actions/models/v2_rest_webhook.rs similarity index 87% rename from src/v2/actions/models/v2beta_rest_webhook.rs rename to src/v2/actions/models/v2_rest_webhook.rs index 8e8bfcce..a6b0179d 100644 --- a/src/v2/actions/models/v2beta_rest_webhook.rs +++ b/src/v2/actions/models/v2_rest_webhook.rs @@ -19,23 +19,23 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaRestWebhook { +pub struct V2RestWebhook { /// Define if any error stops the whole execution. By default the process /// continues as normal. #[serde(rename = "interruptOnError")] interrupt_on_error: Option, } -impl V2betaRestWebhook { - pub fn new() -> V2betaRestWebhook { - V2betaRestWebhook { interrupt_on_error: None } +impl V2RestWebhook { + pub fn new() -> V2RestWebhook { + V2RestWebhook { interrupt_on_error: None } } pub fn set_interrupt_on_error(&mut self, interrupt_on_error: bool) { self.interrupt_on_error = Some(interrupt_on_error); } - pub fn with_interrupt_on_error(mut self, interrupt_on_error: bool) -> V2betaRestWebhook { + pub fn with_interrupt_on_error(mut self, interrupt_on_error: bool) -> V2RestWebhook { self.interrupt_on_error = Some(interrupt_on_error); self } diff --git a/src/v2/actions/models/v2beta_set_execution_request.rs b/src/v2/actions/models/v2_set_execution_request.rs similarity index 70% rename from src/v2/actions/models/v2beta_set_execution_request.rs rename to src/v2/actions/models/v2_set_execution_request.rs index 78d23c07..9cc09f5d 100644 --- a/src/v2/actions/models/v2beta_set_execution_request.rs +++ b/src/v2/actions/models/v2_set_execution_request.rs @@ -19,33 +19,30 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaSetExecutionRequest { +pub struct V2SetExecutionRequest { /// Condition defining when the execution should be used. #[serde(rename = "condition")] - condition: Option, + condition: Option, /// Ordered list of targets called during the execution. #[serde(rename = "targets")] targets: Option>, } -impl V2betaSetExecutionRequest { - pub fn new() -> V2betaSetExecutionRequest { - V2betaSetExecutionRequest { condition: None, targets: None } +impl V2SetExecutionRequest { + pub fn new() -> V2SetExecutionRequest { + V2SetExecutionRequest { condition: None, targets: None } } - pub fn set_condition(&mut self, condition: super::V2betaCondition) { + pub fn set_condition(&mut self, condition: super::V2Condition) { self.condition = Some(condition); } - pub fn with_condition( - mut self, - condition: super::V2betaCondition, - ) -> V2betaSetExecutionRequest { + pub fn with_condition(mut self, condition: super::V2Condition) -> V2SetExecutionRequest { self.condition = Some(condition); self } - pub fn condition(&self) -> Option<&super::V2betaCondition> { + pub fn condition(&self) -> Option<&super::V2Condition> { self.condition.as_ref() } @@ -57,7 +54,7 @@ impl V2betaSetExecutionRequest { self.targets = Some(targets); } - pub fn with_targets(mut self, targets: Vec) -> V2betaSetExecutionRequest { + pub fn with_targets(mut self, targets: Vec) -> V2SetExecutionRequest { self.targets = Some(targets); self } diff --git a/src/v2/actions/models/v2beta_set_execution_response.rs b/src/v2/actions/models/v2_set_execution_response.rs similarity index 79% rename from src/v2/actions/models/v2beta_set_execution_response.rs rename to src/v2/actions/models/v2_set_execution_response.rs index ead50571..949797bc 100644 --- a/src/v2/actions/models/v2beta_set_execution_response.rs +++ b/src/v2/actions/models/v2_set_execution_response.rs @@ -19,22 +19,22 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaSetExecutionResponse { +pub struct V2SetExecutionResponse { /// The timestamp of the execution set. #[serde(rename = "setDate")] set_date: Option, } -impl V2betaSetExecutionResponse { - pub fn new() -> V2betaSetExecutionResponse { - V2betaSetExecutionResponse { set_date: None } +impl V2SetExecutionResponse { + pub fn new() -> V2SetExecutionResponse { + V2SetExecutionResponse { set_date: None } } pub fn set_set_date(&mut self, set_date: String) { self.set_date = Some(set_date); } - pub fn with_set_date(mut self, set_date: String) -> V2betaSetExecutionResponse { + pub fn with_set_date(mut self, set_date: String) -> V2SetExecutionResponse { self.set_date = Some(set_date); self } diff --git a/src/v2/actions/models/v2beta_target.rs b/src/v2/actions/models/v2_target.rs similarity index 76% rename from src/v2/actions/models/v2beta_target.rs rename to src/v2/actions/models/v2_target.rs index cbdb83e3..cda12895 100644 --- a/src/v2/actions/models/v2beta_target.rs +++ b/src/v2/actions/models/v2_target.rs @@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaTarget { +pub struct V2Target { /// The unique identifier of the target. #[serde(rename = "id")] id: Option, @@ -33,11 +33,11 @@ pub struct V2betaTarget { #[serde(rename = "name")] name: Option, #[serde(rename = "restWebhook")] - rest_webhook: Option, + rest_webhook: Option, #[serde(rename = "restCall")] - rest_call: Option, + rest_call: Option, #[serde(rename = "restAsync")] - rest_async: Option, + rest_async: Option, /// Timeout defines the duration until ZITADEL cancels the execution. If the /// target doesn't respond before this timeout expires, the the connection /// is closed and the action fails. Depending on the target type and @@ -50,11 +50,13 @@ pub struct V2betaTarget { endpoint: Option, #[serde(rename = "signingKey")] signing_key: Option, + #[serde(rename = "payloadType")] + payload_type: Option, } -impl V2betaTarget { - pub fn new() -> V2betaTarget { - V2betaTarget { +impl V2Target { + pub fn new() -> V2Target { + V2Target { id: None, creation_date: None, change_date: None, @@ -65,14 +67,19 @@ impl V2betaTarget { timeout: None, endpoint: None, signing_key: None, + payload_type: None, } } + pub fn payload_type(&self) -> Option<&super::V2PayloadType> { + self.payload_type.as_ref() + } + pub fn set_id(&mut self, id: String) { self.id = Some(id); } - pub fn with_id(mut self, id: String) -> V2betaTarget { + pub fn with_id(mut self, id: String) -> V2Target { self.id = Some(id); self } @@ -89,7 +96,7 @@ impl V2betaTarget { self.creation_date = Some(creation_date); } - pub fn with_creation_date(mut self, creation_date: String) -> V2betaTarget { + pub fn with_creation_date(mut self, creation_date: String) -> V2Target { self.creation_date = Some(creation_date); self } @@ -106,7 +113,7 @@ impl V2betaTarget { self.change_date = Some(change_date); } - pub fn with_change_date(mut self, change_date: String) -> V2betaTarget { + pub fn with_change_date(mut self, change_date: String) -> V2Target { self.change_date = Some(change_date); self } @@ -123,7 +130,7 @@ impl V2betaTarget { self.name = Some(name); } - pub fn with_name(mut self, name: String) -> V2betaTarget { + pub fn with_name(mut self, name: String) -> V2Target { self.name = Some(name); self } @@ -136,16 +143,16 @@ impl V2betaTarget { self.name = None; } - pub fn set_rest_webhook(&mut self, rest_webhook: super::V2betaRestWebhook) { + pub fn set_rest_webhook(&mut self, rest_webhook: super::V2RestWebhook) { self.rest_webhook = Some(rest_webhook); } - pub fn with_rest_webhook(mut self, rest_webhook: super::V2betaRestWebhook) -> V2betaTarget { + pub fn with_rest_webhook(mut self, rest_webhook: super::V2RestWebhook) -> V2Target { self.rest_webhook = Some(rest_webhook); self } - pub fn rest_webhook(&self) -> Option<&super::V2betaRestWebhook> { + pub fn rest_webhook(&self) -> Option<&super::V2RestWebhook> { self.rest_webhook.as_ref() } @@ -153,16 +160,16 @@ impl V2betaTarget { self.rest_webhook = None; } - pub fn set_rest_call(&mut self, rest_call: super::V2betaRestCall) { + pub fn set_rest_call(&mut self, rest_call: super::V2RestCall) { self.rest_call = Some(rest_call); } - pub fn with_rest_call(mut self, rest_call: super::V2betaRestCall) -> V2betaTarget { + pub fn with_rest_call(mut self, rest_call: super::V2RestCall) -> V2Target { self.rest_call = Some(rest_call); self } - pub fn rest_call(&self) -> Option<&super::V2betaRestCall> { + pub fn rest_call(&self) -> Option<&super::V2RestCall> { self.rest_call.as_ref() } @@ -170,16 +177,16 @@ impl V2betaTarget { self.rest_call = None; } - pub fn set_rest_async(&mut self, rest_async: super::V2betaRestAsync) { + pub fn set_rest_async(&mut self, rest_async: super::V2RestAsync) { self.rest_async = Some(rest_async); } - pub fn with_rest_async(mut self, rest_async: super::V2betaRestAsync) -> V2betaTarget { + pub fn with_rest_async(mut self, rest_async: super::V2RestAsync) -> V2Target { self.rest_async = Some(rest_async); self } - pub fn rest_async(&self) -> Option<&super::V2betaRestAsync> { + pub fn rest_async(&self) -> Option<&super::V2RestAsync> { self.rest_async.as_ref() } @@ -191,7 +198,7 @@ impl V2betaTarget { self.timeout = Some(timeout); } - pub fn with_timeout(mut self, timeout: String) -> V2betaTarget { + pub fn with_timeout(mut self, timeout: String) -> V2Target { self.timeout = Some(timeout); self } @@ -208,7 +215,7 @@ impl V2betaTarget { self.endpoint = Some(endpoint); } - pub fn with_endpoint(mut self, endpoint: String) -> V2betaTarget { + pub fn with_endpoint(mut self, endpoint: String) -> V2Target { self.endpoint = Some(endpoint); self } @@ -225,7 +232,7 @@ impl V2betaTarget { self.signing_key = Some(signing_key); } - pub fn with_signing_key(mut self, signing_key: String) -> V2betaTarget { + pub fn with_signing_key(mut self, signing_key: String) -> V2Target { self.signing_key = Some(signing_key); self } diff --git a/src/v2/actions/models/v2beta_target_field_name.rs b/src/v2/actions/models/v2_target_field_name.rs similarity index 96% rename from src/v2/actions/models/v2beta_target_field_name.rs rename to src/v2/actions/models/v2_target_field_name.rs index 120e3c1c..36a4efcc 100644 --- a/src/v2/actions/models/v2beta_target_field_name.rs +++ b/src/v2/actions/models/v2_target_field_name.rs @@ -20,7 +20,7 @@ use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] #[allow(non_camel_case_types)] -pub enum V2betaTargetFieldName { +pub enum V2TargetFieldName { TARGET_FIELD_NAME_UNSPECIFIED, TARGET_FIELD_NAME_ID, TARGET_FIELD_NAME_CREATED_DATE, diff --git a/src/v2/actions/models/v2beta_target_filter.rs b/src/v2/actions/models/v2_target_filter.rs similarity index 82% rename from src/v2/actions/models/v2beta_target_filter.rs rename to src/v2/actions/models/v2_target_filter.rs index 59ee6756..dd67abe2 100644 --- a/src/v2/actions/models/v2beta_target_filter.rs +++ b/src/v2/actions/models/v2_target_filter.rs @@ -19,22 +19,22 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaTargetFilter { +pub struct V2TargetFilter { /// the id of the targets to include #[serde(rename = "targetId")] target_id: Option, } -impl V2betaTargetFilter { - pub fn new() -> V2betaTargetFilter { - V2betaTargetFilter { target_id: None } +impl V2TargetFilter { + pub fn new() -> V2TargetFilter { + V2TargetFilter { target_id: None } } pub fn set_target_id(&mut self, target_id: String) { self.target_id = Some(target_id); } - pub fn with_target_id(mut self, target_id: String) -> V2betaTargetFilter { + pub fn with_target_id(mut self, target_id: String) -> V2TargetFilter { self.target_id = Some(target_id); self } diff --git a/src/v2/actions/models/v2beta_target_name_filter.rs b/src/v2/actions/models/v2_target_name_filter.rs similarity index 70% rename from src/v2/actions/models/v2beta_target_name_filter.rs rename to src/v2/actions/models/v2_target_name_filter.rs index d45e0391..cf734a40 100644 --- a/src/v2/actions/models/v2beta_target_name_filter.rs +++ b/src/v2/actions/models/v2_target_name_filter.rs @@ -19,25 +19,25 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaTargetNameFilter { +pub struct V2TargetNameFilter { /// Defines the name of the target to query for. #[serde(rename = "targetName")] target_name: Option, /// defines which text equality method is used #[serde(rename = "method")] - method: Option, + method: Option, } -impl V2betaTargetNameFilter { - pub fn new() -> V2betaTargetNameFilter { - V2betaTargetNameFilter { target_name: None, method: None } +impl V2TargetNameFilter { + pub fn new() -> V2TargetNameFilter { + V2TargetNameFilter { target_name: None, method: None } } pub fn set_target_name(&mut self, target_name: String) { self.target_name = Some(target_name); } - pub fn with_target_name(mut self, target_name: String) -> V2betaTargetNameFilter { + pub fn with_target_name(mut self, target_name: String) -> V2TargetNameFilter { self.target_name = Some(target_name); self } @@ -50,16 +50,16 @@ impl V2betaTargetNameFilter { self.target_name = None; } - pub fn set_method(&mut self, method: super::V2betaTextFilterMethod) { + pub fn set_method(&mut self, method: super::V2TextFilterMethod) { self.method = Some(method); } - pub fn with_method(mut self, method: super::V2betaTextFilterMethod) -> V2betaTargetNameFilter { + pub fn with_method(mut self, method: super::V2TextFilterMethod) -> V2TargetNameFilter { self.method = Some(method); self } - pub fn method(&self) -> Option<&super::V2betaTextFilterMethod> { + pub fn method(&self) -> Option<&super::V2TextFilterMethod> { self.method.as_ref() } diff --git a/src/v2/actions/models/v2beta_target_search_filter.rs b/src/v2/actions/models/v2_target_search_filter.rs similarity index 63% rename from src/v2/actions/models/v2beta_target_search_filter.rs rename to src/v2/actions/models/v2_target_search_filter.rs index ad01f16e..942ccc34 100644 --- a/src/v2/actions/models/v2beta_target_search_filter.rs +++ b/src/v2/actions/models/v2_target_search_filter.rs @@ -19,31 +19,31 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaTargetSearchFilter { +pub struct V2TargetSearchFilter { #[serde(rename = "targetNameFilter")] - target_name_filter: Option, + target_name_filter: Option, #[serde(rename = "inTargetIdsFilter")] - in_target_ids_filter: Option, + in_target_ids_filter: Option, } -impl V2betaTargetSearchFilter { - pub fn new() -> V2betaTargetSearchFilter { - V2betaTargetSearchFilter { target_name_filter: None, in_target_ids_filter: None } +impl V2TargetSearchFilter { + pub fn new() -> V2TargetSearchFilter { + V2TargetSearchFilter { target_name_filter: None, in_target_ids_filter: None } } - pub fn set_target_name_filter(&mut self, target_name_filter: super::V2betaTargetNameFilter) { + pub fn set_target_name_filter(&mut self, target_name_filter: super::V2TargetNameFilter) { self.target_name_filter = Some(target_name_filter); } pub fn with_target_name_filter( mut self, - target_name_filter: super::V2betaTargetNameFilter, - ) -> V2betaTargetSearchFilter { + target_name_filter: super::V2TargetNameFilter, + ) -> V2TargetSearchFilter { self.target_name_filter = Some(target_name_filter); self } - pub fn target_name_filter(&self) -> Option<&super::V2betaTargetNameFilter> { + pub fn target_name_filter(&self) -> Option<&super::V2TargetNameFilter> { self.target_name_filter.as_ref() } @@ -51,22 +51,19 @@ impl V2betaTargetSearchFilter { self.target_name_filter = None; } - pub fn set_in_target_ids_filter( - &mut self, - in_target_ids_filter: super::V2betaInTargetIdsFilter, - ) { + pub fn set_in_target_ids_filter(&mut self, in_target_ids_filter: super::V2InTargetIdsFilter) { self.in_target_ids_filter = Some(in_target_ids_filter); } pub fn with_in_target_ids_filter( mut self, - in_target_ids_filter: super::V2betaInTargetIdsFilter, - ) -> V2betaTargetSearchFilter { + in_target_ids_filter: super::V2InTargetIdsFilter, + ) -> V2TargetSearchFilter { self.in_target_ids_filter = Some(in_target_ids_filter); self } - pub fn in_target_ids_filter(&self) -> Option<&super::V2betaInTargetIdsFilter> { + pub fn in_target_ids_filter(&self) -> Option<&super::V2InTargetIdsFilter> { self.in_target_ids_filter.as_ref() } diff --git a/src/v2/actions/models/v2beta_text_filter_method.rs b/src/v2/actions/models/v2_text_filter_method.rs similarity index 96% rename from src/v2/actions/models/v2beta_text_filter_method.rs rename to src/v2/actions/models/v2_text_filter_method.rs index 8dc7dcc7..17c515fe 100644 --- a/src/v2/actions/models/v2beta_text_filter_method.rs +++ b/src/v2/actions/models/v2_text_filter_method.rs @@ -20,7 +20,7 @@ use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] #[allow(non_camel_case_types)] -pub enum V2betaTextFilterMethod { +pub enum V2TextFilterMethod { TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, diff --git a/src/v2/actions/models/v2beta_update_target_response.rs b/src/v2/actions/models/v2_update_target_response.rs similarity index 79% rename from src/v2/actions/models/v2beta_update_target_response.rs rename to src/v2/actions/models/v2_update_target_response.rs index fc97932a..49f9f5fb 100644 --- a/src/v2/actions/models/v2beta_update_target_response.rs +++ b/src/v2/actions/models/v2_update_target_response.rs @@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct V2betaUpdateTargetResponse { +pub struct V2UpdateTargetResponse { /// The timestamp of the change of the target. #[serde(rename = "changeDate")] change_date: Option, @@ -28,16 +28,16 @@ pub struct V2betaUpdateTargetResponse { signing_key: Option, } -impl V2betaUpdateTargetResponse { - pub fn new() -> V2betaUpdateTargetResponse { - V2betaUpdateTargetResponse { change_date: None, signing_key: None } +impl V2UpdateTargetResponse { + pub fn new() -> V2UpdateTargetResponse { + V2UpdateTargetResponse { change_date: None, signing_key: None } } pub fn set_change_date(&mut self, change_date: String) { self.change_date = Some(change_date); } - pub fn with_change_date(mut self, change_date: String) -> V2betaUpdateTargetResponse { + pub fn with_change_date(mut self, change_date: String) -> V2UpdateTargetResponse { self.change_date = Some(change_date); self } @@ -54,7 +54,7 @@ impl V2betaUpdateTargetResponse { self.signing_key = Some(signing_key); } - pub fn with_signing_key(mut self, signing_key: String) -> V2betaUpdateTargetResponse { + pub fn with_signing_key(mut self, signing_key: String) -> V2UpdateTargetResponse { self.signing_key = Some(signing_key); self }