four/lambda/property/
function_name.rs

1use serde::Serialize;
2
3use crate::{
4    core::{convert::WillBe, PartialArn},
5    lambda::{FunctionArn, FunctionName},
6};
7
8#[derive(Debug, Clone, Serialize)]
9#[serde(untagged)]
10pub enum LooseFunctionName {
11    Name(WillBe<FunctionName>),
12    Arn(WillBe<FunctionArn>),
13    Partial(WillBe<PartialArn>),
14}
15
16impl From<WillBe<FunctionName>> for LooseFunctionName {
17    fn from(value: WillBe<FunctionName>) -> Self {
18        LooseFunctionName::Name(value)
19    }
20}
21
22impl From<WillBe<FunctionArn>> for LooseFunctionName {
23    fn from(value: WillBe<FunctionArn>) -> Self {
24        LooseFunctionName::Arn(value)
25    }
26}
27
28impl From<WillBe<PartialArn>> for LooseFunctionName {
29    fn from(value: WillBe<PartialArn>) -> Self {
30        LooseFunctionName::Partial(value)
31    }
32}