1010 resolve_one_of ,
1111)
1212from .types import (
13+ ContainerHealthCheckSpecHTTPProbe ,
14+ ContainerHealthCheckSpecTCPProbe ,
15+ ContainerHealthCheckSpec ,
1316 ContainerScalingOption ,
1417 SecretHashedValue ,
1518 Container ,
4548)
4649
4750
51+ def unmarshal_ContainerHealthCheckSpecHTTPProbe (
52+ data : Any ,
53+ ) -> ContainerHealthCheckSpecHTTPProbe :
54+ if not isinstance (data , dict ):
55+ raise TypeError (
56+ "Unmarshalling the type 'ContainerHealthCheckSpecHTTPProbe' failed as data isn't a dictionary."
57+ )
58+
59+ args : Dict [str , Any ] = {}
60+
61+ field = data .get ("path" , None )
62+ if field is not None :
63+ args ["path" ] = field
64+
65+ return ContainerHealthCheckSpecHTTPProbe (** args )
66+
67+
68+ def unmarshal_ContainerHealthCheckSpecTCPProbe (
69+ data : Any ,
70+ ) -> ContainerHealthCheckSpecTCPProbe :
71+ if not isinstance (data , dict ):
72+ raise TypeError (
73+ "Unmarshalling the type 'ContainerHealthCheckSpecTCPProbe' failed as data isn't a dictionary."
74+ )
75+
76+ args : Dict [str , Any ] = {}
77+
78+ return ContainerHealthCheckSpecTCPProbe (** args )
79+
80+
81+ def unmarshal_ContainerHealthCheckSpec (data : Any ) -> ContainerHealthCheckSpec :
82+ if not isinstance (data , dict ):
83+ raise TypeError (
84+ "Unmarshalling the type 'ContainerHealthCheckSpec' failed as data isn't a dictionary."
85+ )
86+
87+ args : Dict [str , Any ] = {}
88+
89+ field = data .get ("failure_threshold" , None )
90+ if field is not None :
91+ args ["failure_threshold" ] = field
92+
93+ field = data .get ("http" , None )
94+ if field is not None :
95+ args ["http" ] = unmarshal_ContainerHealthCheckSpecHTTPProbe (field )
96+ else :
97+ args ["http" ] = None
98+
99+ field = data .get ("tcp" , None )
100+ if field is not None :
101+ args ["tcp" ] = unmarshal_ContainerHealthCheckSpecTCPProbe (field )
102+ else :
103+ args ["tcp" ] = None
104+
105+ field = data .get ("interval" , None )
106+ if field is not None :
107+ args ["interval" ] = field
108+ else :
109+ args ["interval" ] = None
110+
111+ return ContainerHealthCheckSpec (** args )
112+
113+
48114def unmarshal_ContainerScalingOption (data : Any ) -> ContainerScalingOption :
49115 if not isinstance (data , dict ):
50116 raise TypeError (
@@ -139,22 +205,6 @@ def unmarshal_Container(data: Any) -> Container:
139205 if field is not None :
140206 args ["registry_image" ] = field
141207
142- field = data .get ("max_concurrency" , None )
143- if field is not None :
144- args ["max_concurrency" ] = field
145-
146- field = data .get ("domain_name" , None )
147- if field is not None :
148- args ["domain_name" ] = field
149-
150- field = data .get ("protocol" , None )
151- if field is not None :
152- args ["protocol" ] = field
153-
154- field = data .get ("port" , None )
155- if field is not None :
156- args ["port" ] = field
157-
158208 field = data .get ("timeout" , None )
159209 if field is not None :
160210 args ["timeout" ] = field
@@ -173,6 +223,22 @@ def unmarshal_Container(data: Any) -> Container:
173223 else :
174224 args ["description" ] = None
175225
226+ field = data .get ("max_concurrency" , None )
227+ if field is not None :
228+ args ["max_concurrency" ] = field
229+
230+ field = data .get ("domain_name" , None )
231+ if field is not None :
232+ args ["domain_name" ] = field
233+
234+ field = data .get ("protocol" , None )
235+ if field is not None :
236+ args ["protocol" ] = field
237+
238+ field = data .get ("port" , None )
239+ if field is not None :
240+ args ["port" ] = field
241+
176242 field = data .get ("secret_environment_variables" , None )
177243 if field is not None :
178244 args ["secret_environment_variables" ] = (
@@ -203,6 +269,12 @@ def unmarshal_Container(data: Any) -> Container:
203269 else :
204270 args ["scaling_option" ] = None
205271
272+ field = data .get ("health_check" , None )
273+ if field is not None :
274+ args ["health_check" ] = unmarshal_ContainerHealthCheckSpec (field )
275+ else :
276+ args ["health_check" ] = None
277+
206278 field = data .get ("created_at" , None )
207279 if field is not None :
208280 args ["created_at" ] = parser .isoparse (field ) if isinstance (field , str ) else field
@@ -696,6 +768,50 @@ def unmarshal_ListTriggersResponse(data: Any) -> ListTriggersResponse:
696768 return ListTriggersResponse (** args )
697769
698770
771+ def marshal_ContainerHealthCheckSpecHTTPProbe (
772+ request : ContainerHealthCheckSpecHTTPProbe ,
773+ defaults : ProfileDefaults ,
774+ ) -> Dict [str , Any ]:
775+ output : Dict [str , Any ] = {}
776+
777+ if request .path is not None :
778+ output ["path" ] = request .path
779+
780+ return output
781+
782+
783+ def marshal_ContainerHealthCheckSpecTCPProbe (
784+ request : ContainerHealthCheckSpecTCPProbe ,
785+ defaults : ProfileDefaults ,
786+ ) -> Dict [str , Any ]:
787+ output : Dict [str , Any ] = {}
788+
789+ return output
790+
791+
792+ def marshal_ContainerHealthCheckSpec (
793+ request : ContainerHealthCheckSpec ,
794+ defaults : ProfileDefaults ,
795+ ) -> Dict [str , Any ]:
796+ output : Dict [str , Any ] = {}
797+ output .update (
798+ resolve_one_of (
799+ [
800+ OneOfPossibility ("http" , request .http ),
801+ OneOfPossibility ("tcp" , request .tcp ),
802+ ]
803+ ),
804+ )
805+
806+ if request .failure_threshold is not None :
807+ output ["failure_threshold" ] = request .failure_threshold
808+
809+ if request .interval is not None :
810+ output ["interval" ] = request .interval
811+
812+ return output
813+
814+
699815def marshal_ContainerScalingOption (
700816 request : ContainerScalingOption ,
701817 defaults : ProfileDefaults ,
@@ -799,6 +915,11 @@ def marshal_CreateContainerRequest(
799915 request .scaling_option , defaults
800916 )
801917
918+ if request .health_check is not None :
919+ output ["health_check" ] = marshal_ContainerHealthCheckSpec (
920+ request .health_check , defaults
921+ )
922+
802923 return output
803924
804925
@@ -1043,6 +1164,11 @@ def marshal_UpdateContainerRequest(
10431164 request .scaling_option , defaults
10441165 )
10451166
1167+ if request .health_check is not None :
1168+ output ["health_check" ] = marshal_ContainerHealthCheckSpec (
1169+ request .health_check , defaults
1170+ )
1171+
10461172 return output
10471173
10481174
0 commit comments