@@ -10,6 +10,9 @@ import {
1010import type { DefaultValues } from '../../../bridge'
1111import type {
1212 Container ,
13+ ContainerHealthCheckSpec ,
14+ ContainerHealthCheckSpecHTTPProbe ,
15+ ContainerHealthCheckSpecTCPProbe ,
1316 ContainerScalingOption ,
1417 CreateContainerRequest ,
1518 CreateCronRequest ,
@@ -43,6 +46,53 @@ import type {
4346 UpdateTriggerRequestSqsClientConfig ,
4447} from './types.gen'
4548
49+ const unmarshalContainerHealthCheckSpecHTTPProbe = (
50+ data : unknown ,
51+ ) : ContainerHealthCheckSpecHTTPProbe => {
52+ if ( ! isJSONObject ( data ) ) {
53+ throw new TypeError (
54+ `Unmarshalling the type 'ContainerHealthCheckSpecHTTPProbe' failed as data isn't a dictionary.` ,
55+ )
56+ }
57+
58+ return {
59+ path : data . path ,
60+ } as ContainerHealthCheckSpecHTTPProbe
61+ }
62+
63+ const unmarshalContainerHealthCheckSpecTCPProbe = (
64+ data : unknown ,
65+ ) : ContainerHealthCheckSpecTCPProbe => {
66+ if ( ! isJSONObject ( data ) ) {
67+ throw new TypeError (
68+ `Unmarshalling the type 'ContainerHealthCheckSpecTCPProbe' failed as data isn't a dictionary.` ,
69+ )
70+ }
71+
72+ return { } as ContainerHealthCheckSpecTCPProbe
73+ }
74+
75+ const unmarshalContainerHealthCheckSpec = (
76+ data : unknown ,
77+ ) : ContainerHealthCheckSpec => {
78+ if ( ! isJSONObject ( data ) ) {
79+ throw new TypeError (
80+ `Unmarshalling the type 'ContainerHealthCheckSpec' failed as data isn't a dictionary.` ,
81+ )
82+ }
83+
84+ return {
85+ failureThreshold : data . failure_threshold ,
86+ http : data . http
87+ ? unmarshalContainerHealthCheckSpecHTTPProbe ( data . http )
88+ : undefined ,
89+ interval : data . interval ,
90+ tcp : data . tcp
91+ ? unmarshalContainerHealthCheckSpecTCPProbe ( data . tcp )
92+ : undefined ,
93+ } as ContainerHealthCheckSpec
94+ }
95+
4696const unmarshalContainerScalingOption = (
4797 data : unknown ,
4898) : ContainerScalingOption => {
@@ -85,6 +135,9 @@ export const unmarshalContainer = (data: unknown): Container => {
85135 domainName : data . domain_name ,
86136 environmentVariables : data . environment_variables ,
87137 errorMessage : data . error_message ,
138+ healthCheck : data . health_check
139+ ? unmarshalContainerHealthCheckSpec ( data . health_check )
140+ : undefined ,
88141 httpOption : data . http_option ,
89142 id : data . id ,
90143 localStorageLimit : data . local_storage_limit ,
@@ -363,6 +416,42 @@ export const unmarshalListTriggersResponse = (
363416 } as ListTriggersResponse
364417}
365418
419+ const marshalContainerHealthCheckSpecHTTPProbe = (
420+ request : ContainerHealthCheckSpecHTTPProbe ,
421+ defaults : DefaultValues ,
422+ ) : Record < string , unknown > => ( {
423+ path : request . path ,
424+ } )
425+
426+ const marshalContainerHealthCheckSpecTCPProbe = (
427+ request : ContainerHealthCheckSpecTCPProbe ,
428+ defaults : DefaultValues ,
429+ ) : Record < string , unknown > => ( { } )
430+
431+ const marshalContainerHealthCheckSpec = (
432+ request : ContainerHealthCheckSpec ,
433+ defaults : DefaultValues ,
434+ ) : Record < string , unknown > => ( {
435+ failure_threshold : request . failureThreshold ,
436+ interval : request . interval ,
437+ ...resolveOneOf ( [
438+ {
439+ param : 'http' ,
440+ value :
441+ request . http !== undefined
442+ ? marshalContainerHealthCheckSpecHTTPProbe ( request . http , defaults )
443+ : undefined ,
444+ } ,
445+ {
446+ param : 'tcp' ,
447+ value :
448+ request . tcp !== undefined
449+ ? marshalContainerHealthCheckSpecTCPProbe ( request . tcp , defaults )
450+ : undefined ,
451+ } ,
452+ ] ) ,
453+ } )
454+
366455const marshalContainerScalingOption = (
367456 request : ContainerScalingOption ,
368457 defaults : DefaultValues ,
@@ -391,6 +480,10 @@ export const marshalCreateContainerRequest = (
391480 cpu_limit : request . cpuLimit ,
392481 description : request . description ,
393482 environment_variables : request . environmentVariables ,
483+ health_check :
484+ request . healthCheck !== undefined
485+ ? marshalContainerHealthCheckSpec ( request . healthCheck , defaults )
486+ : undefined ,
394487 http_option : request . httpOption ,
395488 local_storage_limit : request . localStorageLimit ,
396489 max_concurrency : request . maxConcurrency ,
@@ -541,6 +634,10 @@ export const marshalUpdateContainerRequest = (
541634 cpu_limit : request . cpuLimit ,
542635 description : request . description ,
543636 environment_variables : request . environmentVariables ,
637+ health_check :
638+ request . healthCheck !== undefined
639+ ? marshalContainerHealthCheckSpec ( request . healthCheck , defaults )
640+ : undefined ,
544641 http_option : request . httpOption ,
545642 local_storage_limit : request . localStorageLimit ,
546643 max_concurrency : request . maxConcurrency ,
0 commit comments